diff pytouhou/game/laser.pyx @ 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents 3c2f96f1d715
children
line wrap: on
line diff
--- a/pytouhou/game/laser.pyx
+++ b/pytouhou/game/laser.pyx
@@ -85,7 +85,7 @@ cdef class Laser(Element):
         self.set_anim()
 
 
-    cdef void set_anim(self, long sprite_idx_offset=-1) except *:
+    cdef bint set_anim(self, long sprite_idx_offset=-1) except True:
         if sprite_idx_offset >= 0:
             self.sprite_idx_offset = sprite_idx_offset
 
@@ -221,7 +221,7 @@ cdef class PlayerLaser(Element):
         self.set_anim()
 
 
-    cdef void set_anim(self, long sprite_idx_offset=-1) except *:
+    cdef bint set_anim(self, long sprite_idx_offset=-1) except True:
         if sprite_idx_offset >= 0:
             self.sprite_idx_offset = sprite_idx_offset
 
@@ -232,11 +232,11 @@ cdef class PlayerLaser(Element):
         #self.sprite.blendfunc = 1 #XXX
 
 
-    cdef void cancel(self) except *:
+    cdef bint cancel(self) except True:
         self.anmrunner.interrupt(1)
 
 
-    cdef void update(self) except *:
+    cdef bint update(self) except True:
         if self.anmrunner is not None and not self.anmrunner.run_frame():
             self.anmrunner = None
             self.removed = True