diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-03 22:16:32 +0000 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-03 22:16:32 +0000 |
commit | 000a074c955a1964959ee908300ef49b41170a06 (patch) | |
tree | af32b732d8b3285969bd524a4af25b6533adbb4c /Modules/posixmodule.c | |
parent | 0a83d79268e9d2b36decc78845cf71baced4ccc6 (diff) | |
download | cpython-git-000a074c955a1964959ee908300ef49b41170a06.tar.gz |
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
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 85725f4bf5..696df0dca4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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"); |