Just started working on a project that is using Python to drive C API's. When the C API's take an unhandled event they terminate using a C exit(3).
How can I monitor for these exit conditions with in my Python code and handle and process the error code used in the C functions exit?
I have searched around and tried many of the exception classes to no avail.
I would try this one: http://docs.python.org/library/signal.html
If possible, set it up so you can call/execute the C functions using subprocess. See "Reading from the output of a pipe:" here http://www.doughellmann.com/PyMOTW/subprocess/index.html#module-subprocess