File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1461,6 +1461,19 @@ Py_EndInterpreter(PyThreadState *tstate)
1461
1461
1462
1462
wait_for_thread_shutdown ();
1463
1463
1464
+ if (_Py_atomic_load_relaxed (
1465
+ & (interp -> ceval .pending .calls_to_do )))
1466
+ {
1467
+ // XXX Ensure that the interpreter is running in the current thread?
1468
+ if (_Py_MakePendingCalls (interp ) < 0 ) {
1469
+ PyObject * exc , * val , * tb ;
1470
+ PyErr_Fetch (& exc , & val , & tb );
1471
+ PyErr_BadInternalCall ();
1472
+ _PyErr_ChainExceptions (exc , val , tb );
1473
+ PyErr_Print ();
1474
+ }
1475
+ }
1476
+
1464
1477
call_py_exitfuncs (interp );
1465
1478
1466
1479
if (tstate != interp -> tstate_head || tstate -> next != NULL )
Original file line number Diff line number Diff line change 189
189
PyInterpreterState_Clear (PyInterpreterState * interp )
190
190
{
191
191
PyThreadState * p ;
192
- // XXX Also ensure that all pending calls have been made. Disallow
193
- // registration of more pending calls.
194
192
HEAD_LOCK ();
195
193
for (p = interp -> tstate_head ; p != NULL ; p = p -> next )
196
194
PyThreadState_Clear (p );
You can’t perform that action at this time.
0 commit comments