I am embedding a c++ library (binding done with SIP) in my python application. Under certain circonstances (error cases), this library uses exit(), which causes my entire application to exit. 
Is there a way to catch this event, or do I need to modify the library to handle error cases differently ? 
Thank you very much,
You must modify the source of the library. There is no "exception handling" in C and exit() does not return to the calling code under any circumstances.
How to catch exit() in embedded C++ module from python code?