diff Python/errors.c @ 44439:0cbe94bea2c7 legacy-trunk

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
author Christian Heimes <christian@cheimes.de>
date Thu, 03 Jan 2008 22:16:32 +0000
parents 3bc3f12cae28
children 840064802952
line wrap: on
line diff
--- a/Python/errors.c	Thu Jan 03 21:14:48 2008 +0000
+++ b/Python/errors.c	Thu Jan 03 22:16:32 2008 +0000
@@ -690,7 +690,7 @@
 {
 	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");