if not from_closure and (self.path or inner_node):
if not inner_node:
- if not node.py_cfunc_node:
+ if not node.assmt:
raise InternalError, "DefNode does not have assignment node"
- inner_node = node.py_cfunc_node
+ inner_node = node.assmt.rhs
inner_node.needs_self_code = False
node.needs_outer_scope = False
- # Simple cases
- if not in_closure and not from_closure:
+
+ if node.is_generator:
+ generator_class = self.create_generator_class(target_module_scope, node.pos)
+ elif not in_closure and not from_closure:
return
elif not in_closure:
func_scope.is_passthrough = True