From: Stefan Behnel Date: Sat, 16 May 2009 08:28:19 +0000 (+0200) Subject: fix warning on unused utility code after enumerate() optimisation X-Git-Tag: 0.12.alpha0~299 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=af0741b777016b3cd298b1c7b8c6249ef3674067;p=cython.git fix warning on unused utility code after enumerate() optimisation --- 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]