]> granicus.if.org Git - python/commitdiff
Fix SF bug [ 788011 ] compiler.compileFile fails on csv.py
authorJeremy Hylton <jeremy@alum.mit.edu>
Thu, 28 Aug 2003 02:09:26 +0000 (02:09 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Thu, 28 Aug 2003 02:09:26 +0000 (02:09 +0000)
Bug fix candidate.

Lib/compiler/symbols.py

index 9f47fa3f264da9f63a1544e94d13fa86afe6843c..fa668f1da7005921bdfe6641537cd29c35106fe9 100644 (file)
@@ -220,7 +220,12 @@ class SymbolVisitor:
         self.visit(node.code, scope)
         self.handle_free_vars(scope, parent)
 
-    def visitLambda(self, node, parent):
+    def visitLambda(self, node, parent, assign=0):
+        # Lambda is an expression, so it could appear in an expression
+        # context where assign is passed.  The transformer should catch
+        # any code that has a lambda on the left-hand side.
+        assert not assign 
+        
         for n in node.defaults:
             self.visit(n, parent)
         scope = LambdaScope(self.module, self.klass)