Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: third_party/logilab/astroid/brain/py2mechanize.py

Issue 753543006: pylint: upgrade to 1.4.0 (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 from astroid import MANAGER 1 from astroid import MANAGER, register_module_extender
2 from astroid.builder import AstroidBuilder 2 from astroid.builder import AstroidBuilder
3 3
4 def mechanize_transform(module): 4 def mechanize_transform():
5 fake = AstroidBuilder(MANAGER).string_build(''' 5 return AstroidBuilder(MANAGER).string_build('''
6 6
7 class Browser(object): 7 class Browser(object):
8 def open(self, url, data=None, timeout=None): 8 def open(self, url, data=None, timeout=None):
9 return None 9 return None
10 def open_novisit(self, url, data=None, timeout=None): 10 def open_novisit(self, url, data=None, timeout=None):
11 return None 11 return None
12 def open_local_file(self, filename): 12 def open_local_file(self, filename):
13 return None 13 return None
14 14
15 ''') 15 ''')
16 module.locals['Browser'] = fake.locals['Browser']
17 16
18 import py2stdlib
19 py2stdlib.MODULE_TRANSFORMS['mechanize'] = mechanize_transform
20 17
18 register_module_extender(MANAGER, 'mechanize', mechanize_transform)
OLDNEW
« no previous file with comments | « third_party/logilab/astroid/brain/py2gi.py ('k') | third_party/logilab/astroid/brain/py2pytest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698