Commit 9b566f8e authored by Stefan Behnel's avatar Stefan Behnel

no need to assume an assignment without RHS to be assigning a method

parent 282c5084
......@@ -3776,7 +3776,7 @@ class FinalOptimizePhase(Visitor.CythonTransform, Visitor.NodeRefCleanupMixin):
elif function.cf_state:
# local functions are definitely not methods
may_be_a_method = any(
not isinstance(assignment.rhs, ExprNodes.PyCFunctionNode)
assignment.rhs and not isinstance(assignment.rhs, ExprNodes.PyCFunctionNode)
for assignment in function.cf_state)
if may_be_a_method:
node = self.replace(node, ExprNodes.PyMethodCallNode.from_node(
......
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