title: How do a debug an exception on python shutdown
body: <p>When my process ends, I get output to stderr that looks like:</p>
  
  <pre><code>  Exception exceptions.TypeError: "'NoneType' object is not callable" in &lt;function &lt;lambda&gt; at 0x5507d70&gt; ignored
  </code></pre>
  
  <p>My understanding is that this is caused by exceptions being generated during garbage collection (<strong>del</strong>() ?) or the weakref callback which I know is being used in this application. </p>
  
  <p>What are some methods for finding out where this is coming from ?</p>