[capi-sig] expy 0.5.2 released

Yingjie Lan lanyjie at yahoo.com
Wed Feb 3 10:46:28 CET 2010


Hi,

> Yingjie Lan, 03.02.2010 07:43:
> > in release 0.5.2, expy now supports custom exceptions,
> besides all built-in ones, and exception handling is made
> easy.
> 
> How does that work? I.e., how do you handle exceptions that
> occur inside of
> the plain string that expy uses to integrate C code?
> 

There are several ways to throw exceptions with expy. 
First of all, you can use @throws(...) to throw exceptions based on input and output of a function. Another possibility is to throw exceptions inside your function implementation, and upon return of your code, the wrapper function would return NULL after all necessary reference count management, if any exception is thrown by your function implementation code. Please also refer to the documentation of expy on exception handling here (it also includes how to create a custom exception, and how to manage exception inheritance):

http://expy.sourceforge.net/tutorial.html#exception-for-arguments-returns 


Yingjie


      


More information about the capi-sig mailing list