Change the attribute check for using hasattr instead of looking explicitly into __dict__.

authorClaudiu Popa <pcmanticore@gmail.com>
changeset1cdd3f6a3ac6
branchdefault
phasepublic
hiddenno
parent revision#bd9ee94a908d Give a nice error message when Graphviz is not installed. Closes issue #168.
child revision#467e659fd2eb Announce the move to github in the readme file.
files modified by this revision
pylint/pyreverse/utils.py
# HG changeset patch
# User Claudiu Popa <pcmanticore@gmail.com>
# Date 1449574866 -7200
# Tue Dec 08 13:41:06 2015 +0200
# Node ID 1cdd3f6a3ac684c5e4d661defe368e1be3fd3071
# Parent bd9ee94a908d62fd7270f4eb8af88586b93a6953
Change the attribute check for using hasattr instead of looking explicitly into __dict__.

diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py
@@ -201,10 +201,10 @@
1              return
2          self._visited[node] = 1 # FIXME: use set ?
3          methods = self.get_callbacks(node)
4          if methods[0] is not None:
5              methods[0](node)
6 -        if 'locals' in node.__dict__: # skip Instance and other proxy
7 +        if hasattr(node, 'locals'): # skip Instance and other proxy
8              for local_node in node.values():
9                  self.visit(local_node)
10          if methods[1] is not None:
11              return methods[1](node)