diff options
author | Brian Curtin <brian@python.org> | 2012-04-14 19:19:33 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-04-14 19:19:33 (GMT) |
commit | e6b299faf5120f15f2196b61d447ecdc334c9ffb (patch) | |
tree | 0317b535b79a4dc6ca689bf99f6d193cd7601e15 /Python/import.c | |
parent | 73def61edda551d8374bad949ceb287b4c783df1 (diff) | |
download | cpython-e6b299faf5120f15f2196b61d447ecdc334c9ffb.zip cpython-e6b299faf5120f15f2196b61d447ecdc334c9ffb.tar.gz cpython-e6b299faf5120f15f2196b61d447ecdc334c9ffb.tar.bz2 |
Fix Windows build
Diffstat (limited to 'Python/import.c')
-rw-r--r-- | Python/import.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/import.c b/Python/import.c index 083146b..be83ab4 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2963,7 +2963,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals, Py_INCREF(abs_name); } -#if WITH_THREAD +#ifdef WITH_THREAD _PyImport_AcquireLock(); #endif /* From this point forward, goto error_with_unlock! */ @@ -2999,13 +2999,14 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals, if (PyObject_Not(fromlist)) { if (level == 0 || PyUnicode_GET_LENGTH(name) > 0) { PyObject *front = NULL; + PyObject *partition = NULL; PyObject *borrowed_dot = _PyUnicode_FromId(&single_dot); if (borrowed_dot == NULL) { goto error_with_unlock; } - PyObject *partition = PyUnicode_Partition(name, borrowed_dot); + partition = PyUnicode_Partition(name, borrowed_dot); if (partition == NULL) { goto error_with_unlock; } @@ -3043,7 +3044,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals, NULL); } error_with_unlock: -#if WITH_THREAD +#ifdef WITH_THREAD if (_PyImport_ReleaseLock() < 0) { PyErr_SetString(PyExc_RuntimeError, "not holding the import lock"); } |