title: cython/python: how to catch as exception an external function that "exits" instead of "returns"
body: <p>I'm using Cython to interface an external C function.  The function (a science code with 100k code lines) internally checks for invalid conditions and "exits" if they occur.</p>
  
  <p>How can I get Cython to detect and raise an exception when the external function "exits" instead of "returns"?</p>
  
  <p><strong>Edit:</strong> user2864740 is right, cython actually exits.  (I was running the function inside a python mulitprocessing.Process.  To simplify I got rid of multiprocessing.)  The question now is:</p>
  
  <p>How can I prevent the "exit()" call from the external library to exit Cython (or Python, at a later point).  A try-except construct doesn't catch this.  Can this be caught as exception instead of the whole process dying?</p>
  
  <p>Thanks!</p>