mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-36370: Check for PyErr_Occurred() after PyImport_GetModule() (GH-12504)
This commit is contained in:
parent
d1e768a677
commit
027b09c5a1
4 changed files with 24 additions and 11 deletions
|
@ -2157,8 +2157,10 @@ wait_for_thread_shutdown(void)
|
|||
PyObject *result;
|
||||
PyObject *threading = _PyImport_GetModuleId(&PyId_threading);
|
||||
if (threading == NULL) {
|
||||
/* threading not imported */
|
||||
PyErr_Clear();
|
||||
if (PyErr_Occurred()) {
|
||||
PyErr_WriteUnraisable(NULL);
|
||||
}
|
||||
/* else: threading not imported */
|
||||
return;
|
||||
}
|
||||
result = _PyObject_CallMethodId(threading, &PyId__shutdown, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue