fix warning on unused utility code after enumerate() optimisation
authorStefan Behnel <scoder@users.berlios.de>
Sat, 16 May 2009 08:28:19 +0000 (10:28 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sat, 16 May 2009 08:28:19 +0000 (10:28 +0200)
Cython/Compiler/ExprNodes.py

index 240786592445117effa5e3f24082b462a6db1ac9..c456f262c189e3256faabab1cac0ab3ba92772ca 100644 (file)
@@ -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]