From 000a074c955a1964959ee908300ef49b41170a06 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 3 Jan 2008 22:16:32 +0000 Subject: 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 --- Python/errors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/errors.c') diff --git a/Python/errors.c b/Python/errors.c index 63acf330665..1c29160924a 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"); -- cgit v1.2.3