summaryrefslogtreecommitdiff
path: root/pylint/checkers
diff options
context:
space:
mode:
authorpalazzem <devnull@localhost>2015-09-21 12:52:38 +0100
committerpalazzem <devnull@localhost>2015-09-21 12:52:38 +0100
commita204e5f9a445323214c98bededa5b5a3cf843611 (patch)
tree188fdd0eb729e3251323125e7e0e3f697e7ea1a9 /pylint/checkers
parentb29b4b2eb3b612adfeae738a27a419a7803a399f (diff)
downloadpylint-a204e5f9a445323214c98bededa5b5a3cf843611.tar.gz
deprecated method names are shown correctly
Diffstat (limited to 'pylint/checkers')
-rw-r--r--pylint/checkers/stdlib.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py
index 02d3689..cdf02ea 100644
--- a/pylint/checkers/stdlib.py
+++ b/pylint/checkers/stdlib.py
@@ -243,16 +243,24 @@ class StdlibChecker(BaseChecker):
py_vers = sys.version_info[0]
qname = infer.qname()
+ if(isinstance(node.func, astroid.Attribute)):
+ func_name = node.func.attrname
+ elif isinstance(node.func, astroid.Name):
+ func_name = node.func.name
+ else:
+ return
+
if qname in self.deprecated[0]:
self.add_message('deprecated-method', node=node,
- args=(qname, ))
+ args=(func_name, ))
else:
for since_vers, func_list in self.deprecated[py_vers].items():
if since_vers <= sys.version_info and qname in func_list:
self.add_message('deprecated-method', node=node,
- args=(qname, ))
+ args=(func_name, ))
break
+
def _check_redundant_assert(self, node, infer):
if (isinstance(infer, astroid.BoundMethod) and
node.args and isinstance(node.args[0], astroid.Const) and