mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Modified PyImport_Import and PyImport_ImportModule to always use absolute imports by calling __import__ with an explicit level of 0
Added a new API function PyImport_ImportModuleNoBlock. It solves the problem with dead locks when mixing threads and imports
This commit is contained in:
parent
0a83d79268
commit
000a074c95
19 changed files with 135 additions and 63 deletions
|
@ -5651,7 +5651,7 @@ wait_helper(int pid, int status, struct rusage *ru)
|
|||
return posix_error();
|
||||
|
||||
if (struct_rusage == NULL) {
|
||||
PyObject *m = PyImport_ImportModule("resource");
|
||||
PyObject *m = PyImport_ImportModuleNoBlock("resource");
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
struct_rusage = PyObject_GetAttrString(m, "struct_rusage");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue