title: How to catch runtime error for a python module written in C?
body: <p>Say I have a python module of the form <code>.so</code> and it contains something like this:</p>
  
  <pre><code>static PyObject* f(PyObject* _1, PyObject* _2) {
    int a = 0; 
    a = 1/a;
    return NULL;
  }
  </code></pre>
  
  <p>After running Python will crash. The command line gives <code>Floating point exception: 8</code>. </p>
  
  <p>And I also see this:</p>
  
  <p><a href="https://i.stack.imgur.com/Jwk6V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jwk6V.png" alt="Python Crash"></a></p>
  
  <p>Is this a bug or is it possible to catch this error without change and recompile the <code>.so</code> file?</p>