mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Fix Windows build
This commit is contained in:
parent
73def61edd
commit
e6b299faf5
1 changed files with 4 additions and 3 deletions
|
@ -2963,7 +2963,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
|
||||||
Py_INCREF(abs_name);
|
Py_INCREF(abs_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
_PyImport_AcquireLock();
|
_PyImport_AcquireLock();
|
||||||
#endif
|
#endif
|
||||||
/* From this point forward, goto error_with_unlock! */
|
/* From this point forward, goto error_with_unlock! */
|
||||||
|
@ -2999,13 +2999,14 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
|
||||||
if (PyObject_Not(fromlist)) {
|
if (PyObject_Not(fromlist)) {
|
||||||
if (level == 0 || PyUnicode_GET_LENGTH(name) > 0) {
|
if (level == 0 || PyUnicode_GET_LENGTH(name) > 0) {
|
||||||
PyObject *front = NULL;
|
PyObject *front = NULL;
|
||||||
|
PyObject *partition = NULL;
|
||||||
PyObject *borrowed_dot = _PyUnicode_FromId(&single_dot);
|
PyObject *borrowed_dot = _PyUnicode_FromId(&single_dot);
|
||||||
|
|
||||||
if (borrowed_dot == NULL) {
|
if (borrowed_dot == NULL) {
|
||||||
goto error_with_unlock;
|
goto error_with_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
PyObject *partition = PyUnicode_Partition(name, borrowed_dot);
|
partition = PyUnicode_Partition(name, borrowed_dot);
|
||||||
if (partition == NULL) {
|
if (partition == NULL) {
|
||||||
goto error_with_unlock;
|
goto error_with_unlock;
|
||||||
}
|
}
|
||||||
|
@ -3043,7 +3044,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
error_with_unlock:
|
error_with_unlock:
|
||||||
#if WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
if (_PyImport_ReleaseLock() < 0) {
|
if (_PyImport_ReleaseLock() < 0) {
|
||||||
PyErr_SetString(PyExc_RuntimeError, "not holding the import lock");
|
PyErr_SetString(PyExc_RuntimeError, "not holding the import lock");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue