Avoid iteration over mutating collection in threadpoolexecutor
@@ -67,7 +67,7 @@ def secede():
""" Have this thread secede from the ThreadPoolExecutor """
thread_state.proceed = False
ident = get_thread_identity()
- for t in thread_state.executor._threads:
+ for t in list(thread_state.executor._threads):
if t.ident == ident:
thread_state.executor._threads.remove(t)
break
