Commit cb69432c authored by Stefan Behnel's avatar Stefan Behnel

fix tuple unpacking in PyPy

parent e075739a
...@@ -4911,17 +4911,17 @@ class SequenceNode(ExprNode): ...@@ -4911,17 +4911,17 @@ class SequenceNode(ExprNode):
code.putln("}") code.putln("}")
rhs.generate_disposal_code(code) rhs.generate_disposal_code(code)
code.putln("} else") code.putln("} else")
if rhs.type is tuple_type:
code.putln("if (1) {")
code.globalstate.use_utility_code(tuple_unpacking_error_code)
code.putln("__Pyx_UnpackTupleError(%s, %s); %s" % (
rhs.py_result(), len(self.args), code.error_goto(self.pos)))
code.putln("} else")
code.putln("#endif") code.putln("#endif")
code.putln("{") code.putln("{")
if special_unpack and rhs.type is tuple_type: self.generate_generic_parallel_unpacking_code(
code.globalstate.use_utility_code(tuple_unpacking_error_code) code, rhs, self.unpacked_items, use_loop=long_enough_for_a_loop)
code.putln("__Pyx_UnpackTupleError(%s, %s);" % (
rhs.py_result(), len(self.args)))
code.putln(code.error_goto(self.pos))
else:
self.generate_generic_parallel_unpacking_code(
code, rhs, self.unpacked_items, use_loop=long_enough_for_a_loop)
code.putln("}") code.putln("}")
for value_node in self.coerced_unpacked_items: for value_node in self.coerced_unpacked_items:
......
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