Fixed an issue with the new py3flakes checker.

Wed, 20 Oct 2010 20:48:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 20 Oct 2010 20:48:10 +0200
changeset 689
8ed6155d4d65
parent 688
b4ea6261967a
child 690
a2f8b36625e6

Fixed an issue with the new py3flakes checker.

Utilities/py3flakes/checker.py file | annotate | diff | comparison | revisions
--- 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