diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2007-02-22 13:26:22 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2007-02-22 13:26:22 +0100 |
commit | 4d4e8edb7fc76f46dafdf9d77c3215bece8b8839 (patch) | |
tree | 84b9a13953b574407cf6d61dcbd0083bae0a0308 /checkers | |
parent | 8b65a6ea53fec2f58dff89e37c0f11a93b70a3cf (diff) | |
download | pylint-git-4d4e8edb7fc76f46dafdf9d77c3215bece8b8839.tar.gz |
fix potential bug
Diffstat (limited to 'checkers')
-rw-r--r-- | checkers/classes.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/checkers/classes.py b/checkers/classes.py index a38f21c75..2eb49e68c 100644 --- a/checkers/classes.py +++ b/checkers/classes.py @@ -226,7 +226,9 @@ instance attributes.'} # check if the method overload an attribute try: overridden = klass.instance_attr(node.name)[0] # XXX - while not isinstance(overridden, astng.Class): + # we may be unable to get owner class if this is a monkey + # patched method + while overridden.parent and not isinstance(overridden, astng.Class): overridden = overridden.parent.frame() self.add_message('E0202', args=overridden.name, node=node) except astng.NotFoundError: |