From af0741b777016b3cd298b1c7b8c6249ef3674067 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 16 May 2009 10:28:19 +0200 Subject: [PATCH] fix warning on unused utility code after enumerate() optimisation --- Cython/Compiler/ExprNodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 24078659..c456f262 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -3000,7 +3000,6 @@ class SequenceNode(ExprNode): self.unpacked_items.append(unpacked_item) self.coerced_unpacked_items.append(coerced_unpacked_item) self.type = py_object_type - env.use_utility_code(unpacking_utility_code) def generate_result_code(self, code): self.generate_operation_code(code) @@ -3020,6 +3019,8 @@ class SequenceNode(ExprNode): # allocates the temps in a rather hacky way -- the assignment # is evaluated twice, within each if-block. + code.globalstate.use_utility_code(unpacking_utility_code) + if rhs.type is tuple_type: tuple_check = "likely(%s != Py_None)" else: @@ -3092,6 +3093,8 @@ class SequenceNode(ExprNode): code.putln("}") def generate_starred_assignment_code(self, rhs, code): + code.globalstate.use_utility_code(unpacking_utility_code) + for i, arg in enumerate(self.args): if arg.is_starred: starred_target = self.unpacked_items[i] -- 2.26.2