summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpopa <devnull@localhost>2014-02-14 14:26:01 +0200
committercpopa <devnull@localhost>2014-02-14 14:26:01 +0200
commit4793ddfca747fb86a5b5152f3ae0fb08a7a13adc (patch)
tree72aa392322a7cce4fd0d629316cda64df34b6c53
parent0df5ee5196320f2b92c64603a0d37eab717f6712 (diff)
downloadpylint-4793ddfca747fb86a5b5152f3ae0fb08a7a13adc.tar.gz
Use qname(), remove useless check and add packaging info.
-rw-r--r--__pkginfo__.py2
-rw-r--r--checkers/base.py10
-rw-r--r--debian/control2
3 files changed, 4 insertions, 10 deletions
diff --git a/__pkginfo__.py b/__pkginfo__.py
index eff50aa..8d4d65e 100644
--- a/__pkginfo__.py
+++ b/__pkginfo__.py
@@ -21,7 +21,7 @@ modname = distname = 'pylint'
numversion = (1, 1, 0)
version = '.'.join([str(num) for num in numversion])
-install_requires = ['logilab-common >= 0.53.0', 'astroid >= 0.24.3']
+install_requires = ['logilab-common >= 0.53.0', 'astroid >= 1.0.1']
license = 'GPL'
description = "python code static checker"
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)
diff --git a/debian/control b/debian/control
index ecc265b..313445a 100644
--- a/debian/control
+++ b/debian/control
@@ -19,7 +19,7 @@ Architecture: all
Depends: ${python:Depends},
${misc:Depends},
python-logilab-common (>= 0.53.0),
- python-astroid
+ python-astroid (>= 1.0.1)
Suggests: python-tk
XB-Python-Version: ${python:Versions}
Description: python code static checker and UML diagram generator