better exception message for temp failure tracking
authorStefan Behnel <scoder@users.berlios.de>
Wed, 3 Dec 2008 21:07:12 +0000 (22:07 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 3 Dec 2008 21:07:12 +0000 (22:07 +0100)
Cython/Compiler/ExprNodes.py

index 4153073ea1b0a9c700e16260ed4c2bf428091756..f3f4a396d0f722eb39e300a5abd1ed747fd7c098 100644 (file)
@@ -638,7 +638,12 @@ class NewTempExprNode(ExprNode):
 
     def release_temp_result(self, code):
         if not self.temp_code:
-            raise RuntimeError("No temp (perhaps released multiple times? See self.old_temp)")
+            if self.old_temp:
+                raise RuntimeError("temp %s released multiple times in %s" % (
+                        self.old_temp, self.__class__.__name__))
+            else:
+                raise RuntimeError("no temp, but release requested in %s" % (
+                        self.__class__.__name__))
         code.funcstate.release_temp(self.temp_code)
         self.old_temp = self.temp_code
         self.temp_code = None