fix tuple unpacking bug
authorStefan Behnel <scoder@users.berlios.de>
Thu, 17 Jan 2008 21:55:27 +0000 (22:55 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 17 Jan 2008 21:55:27 +0000 (22:55 +0100)
Cython/Compiler/ExprNodes.py

index f571cc03426ea11db53091c69622504633f8029c..116c0a37d3a4570fa67bf237a6dce9f5aa50e4ee 100644 (file)
@@ -2062,12 +2062,12 @@ class SequenceNode(ExprNode):
                 rhs.py_result(), 
                 rhs.py_result(), 
                 len(self.args)))
+        code.putln("PyObject* tuple = %s;" % rhs.py_result())
         for i in range(len(self.args)):
             item = self.unpacked_items[i]
             code.putln(
-                "%s = PyTuple_GET_ITEM(%s, %s);" % (
+                "%s = PyTuple_GET_ITEM(tuple, %s);" % (
                     item.result_code,
-                    rhs.py_result(),
                     i))
             code.put_incref(item.result_code, item.ctype())
             value_node = self.coerced_unpacked_items[i]