summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
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/timemodule.c
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/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 842ce94..5b4d210 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -515,7 +515,7 @@ is not present, current time as returned by localtime() is used.");
static PyObject *
time_strptime(PyObject *self, PyObject *args)
{
- PyObject *strptime_module = PyImport_ImportModule("_strptime");
+ PyObject *strptime_module = PyImport_ImportModuleNoBlock("_strptime");
PyObject *strptime_result;
if (!strptime_module)
@@ -627,7 +627,7 @@ time_tzset(PyObject *self, PyObject *unused)
{
PyObject* m;
- m = PyImport_ImportModule("time");
+ m = PyImport_ImportModuleNoBlock("time");
if (m == NULL) {
return NULL;
}