diff options
author | cpopa <devnull@localhost> | 2014-02-14 14:26:01 +0200 |
---|---|---|
committer | cpopa <devnull@localhost> | 2014-02-14 14:26:01 +0200 |
commit | 4793ddfca747fb86a5b5152f3ae0fb08a7a13adc (patch) | |
tree | 72aa392322a7cce4fd0d629316cda64df34b6c53 /checkers/base.py | |
parent | 0df5ee5196320f2b92c64603a0d37eab717f6712 (diff) | |
download | pylint-4793ddfca747fb86a5b5152f3ae0fb08a7a13adc.tar.gz |
Use qname(), remove useless check and add packaging info.
Diffstat (limited to 'checkers/base.py')
-rw-r--r-- | checkers/base.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/checkers/base.py b/checkers/base.py index 98f85d8..6795457 100644 --- a/checkers/base.py +++ b/checkers/base.py @@ -345,8 +345,6 @@ class BasicErrorChecker(_BasicChecker): """ Check instantiating abstract class with abc.ABCMeta as metaclass. """ - if not isinstance(node.func, astroid.Name): - return try: infered = node.func.infer().next() except astroid.InferenceError: @@ -359,17 +357,13 @@ class BasicErrorChecker(_BasicChecker): # Python 3.4 has `abc.ABC`, which won't be detected # by ClassNode.metaclass() for ancestor in infered.ancestors(): - if (ancestor.name == 'ABC' and - ancestor.parent and - ancestor.parent.name == 'abc' and + if (ancestor.qname() == 'abc.ABC' and has_abstract_methods(infered)): self.add_message('abstract-class-instantiated', node=node) break return - if (metaclass.name == 'ABCMeta' and - metaclass.parent and - metaclass.parent.name == 'abc' and + if (metaclass.qname() == 'abc.ABCMeta' and has_abstract_methods(infered)): self.add_message('abstract-class-instantiated', node=node) |