Utilities/py3flakes/checker.py

changeset 689
8ed6155d4d65
parent 688
b4ea6261967a
child 791
9ec2ac20e54e
diff -r b4ea6261967a -r 8ed6155d4d65 Utilities/py3flakes/checker.py
--- a/Utilities/py3flakes/checker.py	Wed Oct 20 20:31:53 2010 +0200
+++ b/Utilities/py3flakes/checker.py	Wed Oct 20 20:48:10 2010 +0200
@@ -318,11 +318,12 @@
         if not isinstance(self.scope, ClassScope):
             for scope in self.scopeStack[::-1]:
                 existing = scope.get(value.name)
-                if (isinstance(existing, Importation)
-                        and not existing.used
-                        and (not isinstance(value, Importation) or value.fullName == existing.fullName)
-                        and reportRedef):
-
+                if isinstance(existing, Importation) and \
+                   not existing.used and \
+                   not isinstance(value, UnBinding) and \
+                   (not isinstance(value, Importation) or \
+                    value.fullName == existing.fullName) and \
+                   reportRedef:
                     self.report(messages.RedefinedWhileUnused,
                                 lineno, value.name, scope[value.name].source.lineno)
 

eric ide

mercurial