summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-25 19:48:18 +0200
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-25 19:48:18 +0200
commit457ae56f001adc89839c41d0de3155a1bd8578fd (patch)
tree775f939ad4548b0415a5b94facfd1aa23f24e0b9 /Python/pythonrun.c
parent4d93d975e06ffbfdcbb1a0d0ab5036208fc54ff8 (diff)
downloadcpython-457ae56f001adc89839c41d0de3155a1bd8578fd.tar.gz
Issue #18808: Non-daemon threads are now automatically joined when a sub-interpreter is shutdown (it would previously dump a fatal error).
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index b0bc549647..37dc3b8dc8 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -789,6 +789,9 @@ Py_EndInterpreter(PyThreadState *tstate)
Py_FatalError("Py_EndInterpreter: thread is not current");
if (tstate->frame != NULL)
Py_FatalError("Py_EndInterpreter: thread still has a frame");
+
+ wait_for_thread_shutdown();
+
if (tstate != interp->tstate_head || tstate->next != NULL)
Py_FatalError("Py_EndInterpreter: not the last thread");