summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-09-21 23:50:11 +0000
committerClaudiu Popa <pcmanticore@gmail.com>2015-09-21 23:50:11 +0000
commit9163230f09d103beadadca452a4809fce59bc526 (patch)
tree8a4ff454a41d7bc3da698633d2fc4391642c4f22
parent1b1a8084a3afd30134f8482f0c8de40750ee670f (diff)
downloadpylint-9163230f09d103beadadca452a4809fce59bc526.tar.gz
Retrieve the qualified name only after filtering the proper needs.
-rw-r--r--pylint/checkers/stdlib.py2
-rw-r--r--pylint/test/functional/deprecated_methods_py3.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/pylint/checkers/stdlib.py b/pylint/checkers/stdlib.py
index 493021f..7df71b2 100644
--- a/pylint/checkers/stdlib.py
+++ b/pylint/checkers/stdlib.py
@@ -241,7 +241,6 @@ class StdlibChecker(BaseChecker):
def _check_deprecated_method(self, node, infer):
py_vers = sys.version_info[0]
- qname = infer.qname()
if isinstance(node.func, astroid.Attribute):
func_name = node.func.attrname
@@ -251,6 +250,7 @@ class StdlibChecker(BaseChecker):
# Not interested in other nodes.
return
+ qname = infer.qname()
if qname in self.deprecated[0]:
self.add_message('deprecated-method', node=node,
args=(func_name, ))
diff --git a/pylint/test/functional/deprecated_methods_py3.py b/pylint/test/functional/deprecated_methods_py3.py
index 214964b..06a8517 100644
--- a/pylint/test/functional/deprecated_methods_py3.py
+++ b/pylint/test/functional/deprecated_methods_py3.py
@@ -1,5 +1,5 @@
""" Functional tests for method deprecation. """
-# pylint: disable=missing-docstring
+# pylint: disable=missing-docstring, super-init-not-called, not-callable
import base64
import cgi
import inspect
@@ -26,3 +26,10 @@ platform.popen([]) # [deprecated-method]
base64.encodestring("42") # [deprecated-method]
base64.decodestring("42") # [deprecated-method]
cgi.escape("a") # [deprecated-method]
+
+
+class SuperCrash(unittest.TestCase):
+
+ def __init__(self):
+ # should not crash.
+ super(SuperCrash, self)()