mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Fix compilation under Windows
This commit is contained in:
parent
461c813164
commit
44b4b6a9a5
1 changed files with 2 additions and 1 deletions
|
@ -426,12 +426,13 @@ PyImport_Cleanup(void)
|
||||||
long
|
long
|
||||||
PyImport_GetMagicNumber(void)
|
PyImport_GetMagicNumber(void)
|
||||||
{
|
{
|
||||||
|
long res;
|
||||||
PyInterpreterState *interp = PyThreadState_Get()->interp;
|
PyInterpreterState *interp = PyThreadState_Get()->interp;
|
||||||
PyObject *pyc_magic = PyObject_GetAttrString(interp->importlib,
|
PyObject *pyc_magic = PyObject_GetAttrString(interp->importlib,
|
||||||
"_RAW_MAGIC_NUMBER");
|
"_RAW_MAGIC_NUMBER");
|
||||||
if (pyc_magic == NULL)
|
if (pyc_magic == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
long res = PyLong_AsLong(pyc_magic);
|
res = PyLong_AsLong(pyc_magic);
|
||||||
Py_DECREF(pyc_magic);
|
Py_DECREF(pyc_magic);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue