gh-108444: Remove _PyLong_AsInt() function (#108461)

* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Remove _PyLong_AsInt() alias to PyLong_AsInt().
This commit is contained in:
Victor Stinner 2023-08-25 11:13:59 +02:00 committed by GitHub
parent 24aa249a66
commit e59a95238b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -2,9 +2,6 @@
# error "this header file must not be included directly"
#endif
// Alias for backport compatibility
#define _PyLong_AsInt PyLong_AsInt
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);

View File

@ -1074,7 +1074,7 @@ static int obj2ast_int(struct ast_state* Py_UNUSED(state), PyObject* obj, int* o
return 1;
}
i = _PyLong_AsInt(obj);
i = PyLong_AsInt(obj);
if (i == -1 && PyErr_Occurred())
return 1;
*out = i;

2
Python/Python-ast.c generated
View File

@ -1099,7 +1099,7 @@ static int obj2ast_int(struct ast_state* Py_UNUSED(state), PyObject* obj, int* o
return 1;
}
i = _PyLong_AsInt(obj);
i = PyLong_AsInt(obj);
if (i == -1 && PyErr_Occurred())
return 1;
*out = i;