From c5ddac6e97b2d7b86d66b4c2f3c85a2cfdf15a08 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 17 Jan 2008 22:55:27 +0100 Subject: [PATCH] fix tuple unpacking bug --- Cython/Compiler/ExprNodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index f571cc03..116c0a37 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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] -- 2.26.2