diff options
author | Radu Ciorba <radu@devrandom.ro> | 2015-03-31 22:43:26 +0300 |
---|---|---|
committer | Radu Ciorba <radu@devrandom.ro> | 2015-03-31 22:43:26 +0300 |
commit | 05e723db5178fd7d49de3ec19e8b0bb28871a988 (patch) | |
tree | cdfd4a54b2ca3d3fd67436ea203d6f3985288109 | |
parent | 3da335cc152191fb9f84bc3249d81951dfc9bb71 (diff) | |
download | pylint-unused-import.tar.gz |
fix indentation, add changelog entryunused-import
-rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pylint/checkers/variables.py | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index f24bad0..5414fad 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -56,7 +56,7 @@ Order doesn't matter (not that much, at least ;) * Steven Myint: duplicate-except. -* Radu Ciorbă: not-context-manager and confusing-with-statement warnings. +* Radu Ciorba: not-context-manager and confusing-with-statement warnings. * Wolfgang Grafen, Axel Muller, Fabio Zadrozny, Pierre Rouleau, Maarten ter Huurne, Mirko Friedenhagen and all the Logilab's team (among others): @@ -2,6 +2,9 @@ ChangeLog for Pylint -------------------- -- + * Fix unused-import false positive when the import is used in a + class assignment. Closes issue #475 + * Add a new error, 'not-context-manager', emitted when something that doesn't implement __enter__ and __exit__ is used in a with statement. diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index db99e97..8653d54 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -792,8 +792,8 @@ builtins. Remember that you should avoid to define new builtins when possible.' # mark the name as consumed if it's defined in this scope found_node = to_consume.get(name) if (found_node - and isinstance(node.parent, astroid.Assign) - and node.parent == found_node[0].parent): + and isinstance(node.parent, astroid.Assign) + and node.parent == found_node[0].parent): lhs = found_node[0].parent.targets[0] if lhs.name == name: # this name is defined in this very statement found_node = None |