mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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
|
@ -776,7 +776,7 @@ get_decompress_func(void)
|
|||
let's avoid a stack overflow. */
|
||||
return NULL;
|
||||
importing_zlib = 1;
|
||||
zlib = PyImport_ImportModule("zlib"); /* import zlib */
|
||||
zlib = PyImport_ImportModuleNoBlock("zlib");
|
||||
importing_zlib = 0;
|
||||
if (zlib != NULL) {
|
||||
decompress = PyObject_GetAttrString(zlib,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue