On Feb 3, 2009, at 2:30 AM, Daniele Pianu wrote: > Probably I've not completely understood the C-function > exception-propagating mechanism. I've a function with a prototype like > this > > void* getItem( void* self, int i ) > > The function returns the i-th item in self. Some index and bounds > checking are implemented, so if, for example, I specify a negative > index or an index out of self bounds I raise and exception. In cython > the function is declared in this way: > > cdef void* getItem( void* self, int i ) except NULL > > But when an error occurs and the exception is raised I always receive > a message which says that the exception is ignored. Obviously, the > function continues its execution and terminates whit a segmentation > fault. > > The question is: how can I propagate to caller functions the raised > exception? > Thanks for your help (and for the great work that you've done with > cython :D ),
Perhaps the function you're calling this from is a cdef function without a way to propagate the error? It's really hard to debug without some more context though, perhaps you could put a self- contained example up at http://pastebin.com/ - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
