diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2016-05-10 15:36:46 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2016-05-10 15:36:46 +0300 |
commit | fa455f0051942ea785ba6f18dbf66d4cfb11fae1 (patch) | |
tree | 2a62d8ba5fda37fdc521d32bb45e87ac3b40508a /pylint/checkers/classes.py | |
parent | 713987822bf6e9ebd90d15597789876206c48d0e (diff) | |
download | pylint-git-fa455f0051942ea785ba6f18dbf66d4cfb11fae1.tar.gz |
Don't crash when checking, for super-init-not-called, a method defined in an if block.
Diffstat (limited to 'pylint/checkers/classes.py')
-rw-r--r-- | pylint/checkers/classes.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index dd0333077..8e97a958d 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -923,7 +923,8 @@ a metaclass class method.'} except astroid.InferenceError: continue for klass, method in six.iteritems(not_called_yet): - if klass.name == 'object' or method.parent.name == 'object': + cls = node_frame_class(method) + if klass.name == 'object' or (cls and cls.name == 'object'): continue self.add_message('super-init-not-called', args=klass.name, node=node) |