]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-108444: Remove _PyLong_AsInt() function (#108461)
authorVictor Stinner <vstinner@python.org>
Fri, 25 Aug 2023 09:13:59 +0000 (11:13 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Aug 2023 09:13:59 +0000 (11:13 +0200)
* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Remove _PyLong_AsInt() alias to PyLong_AsInt().

Include/cpython/longobject.h
Parser/asdl_c.py
Python/Python-ast.c

index c96f35188c47fee0ae05cda25cd8cd6b131de480..7401566636a1040ec6aac12c5813f444f29e0a33 100644 (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 *);
index bf144871bb7364cdde6db84b09cb43afe4b691f2..ca259c8cd1f3ba4ea36aaedf23fd8c7a6925acce 100755 (executable)
@@ -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;
index 60dd121d60b8d067d5b2d29ff14f489b5cb901ab..77b23f7c5edf2376768564edf3c399faded8a73b 100644 (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;