From e59a95238b76f518e936b6e70da9207d923964db Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 25 Aug 2023 11:13:59 +0200 Subject: [PATCH] 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(). --- Include/cpython/longobject.h | 3 --- Parser/asdl_c.py | 2 +- Python/Python-ast.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Include/cpython/longobject.h b/Include/cpython/longobject.h index c96f35188c4..7401566636a 100644 --- a/Include/cpython/longobject.h +++ b/Include/cpython/longobject.h @@ -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 *); diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index bf144871bb7..ca259c8cd1f 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -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; diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 60dd121d60b..77b23f7c5ed 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -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;