Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ead21f5

Browse files
committed
Fix SF bug [ 788011 ] compiler.compileFile fails on csv.py
Bug fix candidate.
1 parent 4651f53 commit ead21f5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/compiler/symbols.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ def visitFunction(self, node, parent):
220220
self.visit(node.code, scope)
221221
self.handle_free_vars(scope, parent)
222222

223-
def visitLambda(self, node, parent):
223+
def visitLambda(self, node, parent, assign=0):
224+
# Lambda is an expression, so it could appear in an expression
225+
# context where assign is passed. The transformer should catch
226+
# any code that has a lambda on the left-hand side.
227+
assert not assign
228+
224229
for n in node.defaults:
225230
self.visit(n, parent)
226231
scope = LambdaScope(self.module, self.klass)

0 commit comments

Comments
 (0)