Fixed an issue in py3flakes.

Tue, 27 Jul 2010 19:52:41 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 27 Jul 2010 19:52:41 +0200
changeset 421
c32c27fd0794
parent 420
af8258a2d17e
child 422
dd7c1558b1df

Fixed an issue in py3flakes.

Utilities/py3flakes/checker.py file | annotate | diff | comparison | revisions
diff -r af8258a2d17e -r c32c27fd0794 Utilities/py3flakes/checker.py
--- a/Utilities/py3flakes/checker.py	Tue Jul 27 19:52:20 2010 +0200
+++ b/Utilities/py3flakes/checker.py	Tue Jul 27 19:52:41 2010 +0200
@@ -328,10 +328,13 @@
         # matter what, since there's always a "foo" part.
         self.handleNode(node.context_expr, node)
 
+        arg = None
         if node.optional_vars is not None:
-            self.handleNode(node.optional_vars, node)
-
+            arg = Argument(node.optional_vars.id, node)
+            self.addBinding(node.lineno, arg, reportRedef=False)
         self.handleBody(node)
+        if arg:
+            del self.scope[arg.name]
 
     def GLOBAL(self, node):
         """

eric ide

mercurial