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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/logilab/astroid/brain/py2mechanize.py
diff --git a/third_party/logilab/astroid/brain/py2mechanize.py b/third_party/logilab/astroid/brain/py2mechanize.py
index 1e0b102d88330ea4836d836e65eb6f51d267bdd4..20a253a4580468c580d81a6befdb9a9b7e2f6b0a 100644
--- a/third_party/logilab/astroid/brain/py2mechanize.py
+++ b/third_party/logilab/astroid/brain/py2mechanize.py
@@ -1,8 +1,8 @@
-from astroid import MANAGER
+from astroid import MANAGER, register_module_extender
from astroid.builder import AstroidBuilder
-def mechanize_transform(module):
- fake = AstroidBuilder(MANAGER).string_build('''
+def mechanize_transform():
+ return AstroidBuilder(MANAGER).string_build('''
class Browser(object):
def open(self, url, data=None, timeout=None):
@@ -13,8 +13,6 @@ class Browser(object):
return None
''')
- module.locals['Browser'] = fake.locals['Browser']
-import py2stdlib
-py2stdlib.MODULE_TRANSFORMS['mechanize'] = mechanize_transform
+register_module_extender(MANAGER, 'mechanize', mechanize_transform)
« 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