diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-08-25 19:48:18 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-08-25 19:48:18 +0200 |
commit | 457ae56f001adc89839c41d0de3155a1bd8578fd (patch) | |
tree | 775f939ad4548b0415a5b94facfd1aa23f24e0b9 /Python/pythonrun.c | |
parent | 4d93d975e06ffbfdcbb1a0d0ab5036208fc54ff8 (diff) | |
download | cpython-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.c | 3 |
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"); |