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 | 4d80cb18b7fc2faccf7dc06fb9b906236b19eebb (patch) | |
| tree | 0b5191b2c742e528a1933f7633fb4c7ec91f8d0e /Python/errors.c | |
| parent | 8e1393025ff6df89ce5c28970ac30f781d374564 (diff) | |
| download | cpython-4d80cb18b7fc2faccf7dc06fb9b906236b19eebb.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 'Python/errors.c')
| -rw-r--r-- | Python/errors.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c index 63acf33066..1c29160924 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -690,7 +690,7 @@ PyErr_WarnExplicit(PyObject *category, const char *message, { PyObject *mod, *dict, *func = NULL; - mod = PyImport_ImportModule("warnings"); + mod = PyImport_ImportModuleNoBlock("warnings"); if (mod != NULL) { dict = PyModule_GetDict(mod); func = PyDict_GetItemString(dict, "warn_explicit"); |
