Permalink
Browse files

stdpy: protect against thread error when interpreter shuts down

  • Loading branch information...
rdb committed Aug 29, 2017
1 parent 1dc02f6 commit c66b4792d745aacb4a848465a767edf87e7ab6b9
Showing with 4 additions and 0 deletions.
  1. +4 −0 direct/src/stdpy/thread.py
@@ -221,6 +221,10 @@ def _get_thread_locals(thread, i):
def _remove_thread_id(threadId):
""" Removes the thread with the indicated ID from the thread list. """
# On interpreter shutdown, Python may set module globals to None.
if _threadsLock is None or _threads is None:
return
_threadsLock.acquire()
try:
thread, locals, wrapper = _threads[threadId]

0 comments on commit c66b479

Please sign in to comment.