diff options
author | FELD Boris <lothiraldan@gmail.com> | 2012-07-09 17:23:46 +0200 |
---|---|---|
committer | FELD Boris <lothiraldan@gmail.com> | 2012-07-09 17:23:46 +0200 |
commit | 30ea2492e86523e21f940f0ae09a1366b6070600 (patch) | |
tree | df05fce0025774badaf5f3b66d9fea2480f0b5d9 /checkers | |
parent | ee1a5b1e0e3c68b3747f88c8f82b2d9544408ae5 (diff) | |
download | pylint-git-30ea2492e86523e21f940f0ae09a1366b6070600.tar.gz |
Fix checkers.utils for other implementations (use of __builtins__). Closes #99139. Closes #89838. Theses fixes need fixes on logilab-astng and logilab-common
Diffstat (limited to 'checkers')
-rw-r--r-- | checkers/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/checkers/utils.py b/checkers/utils.py index f4fc4a88e..cff12fe31 100644 --- a/checkers/utils.py +++ b/checkers/utils.py @@ -33,7 +33,7 @@ def is_inside_except(node): current = node while current and not isinstance(current.parent, astng.ExceptHandler): current = current.parent - + return current and current is current.parent.name @@ -113,7 +113,7 @@ def is_empty(body): """return true if the given node does nothing but 'pass'""" return len(body) == 1 and isinstance(body[0], astng.Pass) -builtins = __builtins__.copy() +builtins = builtins.__dict__.copy() SPECIAL_BUILTINS = ('__builtins__',) # '__path__', '__file__') def is_builtin(name): # was is_native_builtin @@ -370,4 +370,4 @@ def is_attr_private(attrname): at most one trailing underscore) """ regex = re.compile('^_{2,}.*[^_]+_?$') - return regex.match(attrname)
\ No newline at end of file + return regex.match(attrname) |