Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6b299f

Browse files
committed
Fix Windows build
1 parent 73def61 commit e6b299f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Python/import.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
29632963
Py_INCREF(abs_name);
29642964
}
29652965

2966-
#if WITH_THREAD
2966+
#ifdef WITH_THREAD
29672967
_PyImport_AcquireLock();
29682968
#endif
29692969
/* From this point forward, goto error_with_unlock! */
@@ -2999,13 +2999,14 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
29992999
if (PyObject_Not(fromlist)) {
30003000
if (level == 0 || PyUnicode_GET_LENGTH(name) > 0) {
30013001
PyObject *front = NULL;
3002+
PyObject *partition = NULL;
30023003
PyObject *borrowed_dot = _PyUnicode_FromId(&single_dot);
30033004

30043005
if (borrowed_dot == NULL) {
30053006
goto error_with_unlock;
30063007
}
30073008

3008-
PyObject *partition = PyUnicode_Partition(name, borrowed_dot);
3009+
partition = PyUnicode_Partition(name, borrowed_dot);
30093010
if (partition == NULL) {
30103011
goto error_with_unlock;
30113012
}
@@ -3043,7 +3044,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
30433044
NULL);
30443045
}
30453046
error_with_unlock:
3046-
#if WITH_THREAD
3047+
#ifdef WITH_THREAD
30473048
if (_PyImport_ReleaseLock() < 0) {
30483049
PyErr_SetString(PyExc_RuntimeError, "not holding the import lock");
30493050
}

0 commit comments

Comments
 (0)