Commit d672f6f0 authored by Stefan Behnel's avatar Stefan Behnel

repair compiler crash due to attribute error

parent 957f6b44
...@@ -197,6 +197,7 @@ class Node(object): ...@@ -197,6 +197,7 @@ class Node(object):
is_nonecheck = 0 is_nonecheck = 0
is_literal = 0 is_literal = 0
is_terminator = 0 is_terminator = 0
is_wrapper = False # is a DefNode wrapper for a C function
temps = None temps = None
# All descendants should set child_attrs to a list of the attributes # All descendants should set child_attrs to a list of the attributes
...@@ -1616,7 +1617,6 @@ class FuncDefNode(StatNode, BlockNode): ...@@ -1616,7 +1617,6 @@ class FuncDefNode(StatNode, BlockNode):
needs_closure = False needs_closure = False
needs_outer_scope = False needs_outer_scope = False
pymethdef_required = False pymethdef_required = False
is_wrapper = False
is_generator = False is_generator = False
is_generator_body = False is_generator_body = False
is_async_def = False is_async_def = False
......
...@@ -1697,7 +1697,7 @@ if VALUE is not None: ...@@ -1697,7 +1697,7 @@ if VALUE is not None:
def visit_DefNode(self, node): def visit_DefNode(self, node):
node = self.visit_FuncDefNode(node) node = self.visit_FuncDefNode(node)
env = self.current_env() env = self.current_env()
if node.is_wrapper: if isinstance(node, Nodes.DefNode) and node.is_wrapper:
env = env.parent_scope env = env.parent_scope
if (not isinstance(node, Nodes.DefNode) or if (not isinstance(node, Nodes.DefNode) or
node.fused_py_func or node.is_generator_body or node.fused_py_func or node.is_generator_body or
......
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