summaryrefslogtreecommitdiff
path: root/checkers
diff options
context:
space:
mode:
authorSylvain Thénault <sylvain.thenault@logilab.fr>2007-02-22 13:26:22 +0100
committerSylvain Thénault <sylvain.thenault@logilab.fr>2007-02-22 13:26:22 +0100
commit4d4e8edb7fc76f46dafdf9d77c3215bece8b8839 (patch)
tree84b9a13953b574407cf6d61dcbd0083bae0a0308 /checkers
parent8b65a6ea53fec2f58dff89e37c0f11a93b70a3cf (diff)
downloadpylint-git-4d4e8edb7fc76f46dafdf9d77c3215bece8b8839.tar.gz
fix potential bug
Diffstat (limited to 'checkers')
-rw-r--r--checkers/classes.py4
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: