title: error: PyEval_RestoreThread: NULL tstate in TKinter
body: <p>I'm getting a very unhelpful error message whenever I click on a menu option in TKinter:</p>
  
  <pre class="lang-none prettyprint-override"><code>Fatal Python error: PyEval_RestoreThread: NULL tstate
  
  This application has requested the Runtime to terminate it in an unusual way.
  Please contact the application's support team for more information.
  </code></pre>
  
  <p>The problem is, it's intermittent, it happens about every five or six attempts to click on a menu item, and there's no line numbers or anything that could point me in the right direction. The codebase for the program is very large, and since I don't know which part of the code is causing it, I don't know what to share to try to find the root cause.</p>
  
  <p><a href="https://stackoverflow.com/questions/7434408/fatal-python-error-pyeval-restorethread-null-tstate">This thread</a> says it can be fixed by updating gtk, but I'm not using gtk at all. I'm using Python 2.7, tkinter version 8.5, and running on windows. If anyone knows how I can fix this, or even where I can try to find the offending code, I would appreciate it.</p>
  
  <p>If you're okay with poring over thousands of lines of code, here's the <a href="https://github.com/digiholic/universalSmashSystem" rel="nofollow noreferrer">GitHub</a> and the file that loads the <a href="https://github.com/digiholic/universalSmashSystem/blob/master/builder/builderWindow.py" rel="nofollow noreferrer">TKinter code</a></p>