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
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index 6c4a6ad..5764c24 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -3269,7 +3269,7 @@
* If this fails, the import of this module will fail because an
* exception will be raised here; should we clear the exception?
*/
- copyreg = PyImport_ImportModule("copy_reg");
+ copyreg = PyImport_ImportModuleNoBlock("copy_reg");
if (copyreg != NULL) {
PyObject *func, *pickler;