summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-03 22:16:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-03 22:16:32 (GMT)
commit000a074c955a1964959ee908300ef49b41170a06 (patch)
treeaf32b732d8b3285969bd524a4af25b6533adbb4c /Modules/cjkcodecs
parent0a83d79268e9d2b36decc78845cf71baced4ccc6 (diff)
downloadcpython-000a074c955a1964959ee908300ef49b41170a06.zip
cpython-000a074c955a1964959ee908300ef49b41170a06.tar.gz
cpython-000a074c955a1964959ee908300ef49b41170a06.tar.bz2
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/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index 71c54f0..4005bcf 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -245,7 +245,7 @@ getmultibytecodec(void)
static PyObject *cofunc = NULL;
if (cofunc == NULL) {
- PyObject *mod = PyImport_ImportModule("_multibytecodec");
+ PyObject *mod = PyImport_ImportModuleNoBlock("_multibytecodec");
if (mod == NULL)
return NULL;
cofunc = PyObject_GetAttrString(mod, "__create_codec");