diff options
-rw-r--r-- | pylint/checkers/stdlib.py | 2 | ||||
-rw-r--r-- | pylint/test/functional/deprecated_methods_py3.py | 9 |
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)() |