Commit d4e00b5c authored by Stefan Behnel's avatar Stefan Behnel

prevent auto_cpdef from breaking module-level lambdas

--HG--
extra : transplant_source : %FE%F3%DD2%1F-DN%11%05%F1%F5%1C%B3%B2C%90a%0C%10
parent 29724667
...@@ -2031,6 +2031,10 @@ class AlignFunctionDefinitions(CythonTransform): ...@@ -2031,6 +2031,10 @@ class AlignFunctionDefinitions(CythonTransform):
# self.visitchildren(node) # self.visitchildren(node)
return node return node
def visit_ExprNode(self, node):
# ignore lambdas and everything else that appears in expressions
return node
class RemoveUnreachableCode(CythonTransform): class RemoveUnreachableCode(CythonTransform):
def visit_Node(self, node): def visit_Node(self, node):
......
...@@ -37,3 +37,11 @@ def starstararg_func(**kwargs): ...@@ -37,3 +37,11 @@ def starstararg_func(**kwargs):
1 1
""" """
return kwargs['a'] return kwargs['a']
l = lambda x: 1
def test_lambda():
"""
>>> l(1)
1
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment