[Pyrex] incomplete type

Bryan Weingarten bryan.weingarten at pobox.com
Fri Oct 24 02:51:58 CEST 2003


when i execute the play function on windows and press control-c, i'm 
able to catch the KeyboardInterrupt and everything works correctly.  
when this i run on linux the warning appears after each control-c that 
is pressed:

Exception exceptions.KeyboardInterrupt in 'mpgedit._callback_wrapper' ignored

the callback_wrapper does have the "except *" so i would have thought that the above exception would have been handled correctly.  

any ideas?


bryan

----------



cdef extern from "playif.h":
    void * mpgedit_play_init(char *name)
    int  mpgedit_play_frame(void *ctx) except *
    ctypedef int (*status)(void *user_data, long sec, long msec) except *
    void mpgedit_play_set_status_callback(void *ctx, status callback, 
void *user_data)

cdef class Play:   
    cdef void   *ctx
    cdef object  callback
    
    def __init__(self, mp3file):        
        self.ctx = mpgedit_play_init(mp3file)
        
    def play(self, callback=None):
        self.callback = callback
        if callback:
            mpgedit_play_set_status_callback(self.ctx, 
_callback_wrapper, <void*>callback)                                    
        while(mpgedit_play_frame(self.ctx)): pass            
                                                               
                                     
    def status_callback(self, callback):  
        self.callback = callback            
        mpgedit_play_set_status_callback(self.ctx, _callback_wrapper, 
<void*>callback)

cdef int _callback_wrapper(void *callback, long sec, long msec) except 
*:     
    return (<object>callback)((sec, msec))





More information about the Pyrex mailing list