summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-11-23 17:09:36 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-11-23 17:09:36 +0200
commit0c2d1665478d2117186c2d0c43e4b5da11fe6caf (patch)
tree9e57fc772454b721779a3ec137353c23c4518861
parent87c09448cc4252fa24136af80b792bc7ad1be569 (diff)
downloadpylint-0c2d1665478d2117186c2d0c43e4b5da11fe6caf.tar.gz
Choose properly the objects with a .locals attribute in pyreverse.utils.LocalsVisitor
The previous code was looking into __dict__ for this, but since astroid 1.4.0, locals is deprecated in favor of get_locals, being coded as a property, which doesn't exist in __dict__. This might be changed in the future in order to use an ABC instead.
-rw-r--r--pylint/pyreverse/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py
index 9609ad0..90e973d 100644
--- a/pylint/pyreverse/utils.py
+++ b/pylint/pyreverse/utils.py
@@ -203,7 +203,7 @@ class LocalsVisitor(ASTWalker):
methods = self.get_callbacks(node)
if methods[0] is not None:
methods[0](node)
- if 'locals' in node.__dict__: # skip Instance and other proxy
+ if hasattr(node, 'locals'): # skip Instance and other proxy
for local_node in node.values():
self.visit(local_node)
if methods[1] is not None: