summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-24 22:51:22 (GMT)
committerGitHub <noreply@github.com>2023-08-24 22:51:22 (GMT)
commit4e5a7284eef4308dce252ca1115d4a5a5b7e6ae8 (patch)
tree31cacab08c7168e0868d6231a70b4a679fffdf58 /Python
parentbe800f4be78106d7566c694b3a5652761798db96 (diff)
downloadcpython-4e5a7284eef4308dce252ca1115d4a5a5b7e6ae8.zip
cpython-4e5a7284eef4308dce252ca1115d4a5a5b7e6ae8.tar.gz
cpython-4e5a7284eef4308dce252ca1115d4a5a5b7e6ae8.tar.bz2
gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)
Argument Clinic now uses the new public PyLong_AsInt(), rather than the old name _PyLong_AsInt().
Diffstat (limited to 'Python')
-rw-r--r--Python/clinic/_warnings.c.h4
-rw-r--r--Python/clinic/bltinmodule.c.h12
-rw-r--r--Python/clinic/import.c.h6
-rw-r--r--Python/clinic/instrumentation.c.h24
-rw-r--r--Python/clinic/marshal.c.h6
-rw-r--r--Python/clinic/sysmodule.c.h16
-rw-r--r--Python/clinic/traceback.c.h6
7 files changed, 37 insertions, 37 deletions
diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h
index c716639..b39e412 100644
--- a/Python/clinic/_warnings.c.h
+++ b/Python/clinic/_warnings.c.h
@@ -194,7 +194,7 @@ warnings_warn_explicit(PyObject *module, PyObject *const *args, Py_ssize_t nargs
goto exit;
}
filename = args[2];
- lineno = _PyLong_AsInt(args[3]);
+ lineno = PyLong_AsInt(args[3]);
if (lineno == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -243,4 +243,4 @@ warnings_filters_mutated(PyObject *module, PyObject *Py_UNUSED(ignored))
{
return warnings_filters_mutated_impl(module);
}
-/*[clinic end generated code: output=f8d67e0f75771c36 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0e2b367a662bf51b input=a9049054013a1b77]*/
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h
index 7540de6..b0d6929 100644
--- a/Python/clinic/bltinmodule.c.h
+++ b/Python/clinic/bltinmodule.c.h
@@ -99,7 +99,7 @@ builtin___import__(PyObject *module, PyObject *const *args, Py_ssize_t nargs, Py
goto skip_optional_pos;
}
}
- level = _PyLong_AsInt(args[4]);
+ level = PyLong_AsInt(args[4]);
if (level == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -242,7 +242,7 @@ builtin_chr(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int i;
- i = _PyLong_AsInt(arg);
+ i = PyLong_AsInt(arg);
if (i == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -342,7 +342,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj
goto skip_optional_pos;
}
if (args[3]) {
- flags = _PyLong_AsInt(args[3]);
+ flags = PyLong_AsInt(args[3]);
if (flags == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -360,7 +360,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj
}
}
if (args[5]) {
- optimize = _PyLong_AsInt(args[5]);
+ optimize = PyLong_AsInt(args[5]);
if (optimize == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -372,7 +372,7 @@ skip_optional_pos:
if (!noptargs) {
goto skip_optional_kwonly;
}
- feature_version = _PyLong_AsInt(args[6]);
+ feature_version = PyLong_AsInt(args[6]);
if (feature_version == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -1212,4 +1212,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=daeee81b018824f4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bb2da8ccae4190e9 input=a9049054013a1b77]*/
diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h
index dec9ea9..fd54033 100644
--- a/Python/clinic/import.c.h
+++ b/Python/clinic/import.c.h
@@ -411,7 +411,7 @@ _imp__override_frozen_modules_for_tests(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int override;
- override = _PyLong_AsInt(arg);
+ override = PyLong_AsInt(arg);
if (override == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -442,7 +442,7 @@ _imp__override_multi_interp_extensions_check(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int override;
- override = _PyLong_AsInt(arg);
+ override = PyLong_AsInt(arg);
if (override == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -627,4 +627,4 @@ exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=a95ec234672280a2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d97b56ef622cb28a input=a9049054013a1b77]*/
diff --git a/Python/clinic/instrumentation.c.h b/Python/clinic/instrumentation.c.h
index cf3984c..c97fb97 100644
--- a/Python/clinic/instrumentation.c.h
+++ b/Python/clinic/instrumentation.c.h
@@ -29,7 +29,7 @@ monitoring_use_tool_id(PyObject *module, PyObject *const *args, Py_ssize_t nargs
if (!_PyArg_CheckPositional("use_tool_id", nargs, 2, 2)) {
goto exit;
}
- tool_id = _PyLong_AsInt(args[0]);
+ tool_id = PyLong_AsInt(args[0]);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -57,7 +57,7 @@ monitoring_free_tool_id(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int tool_id;
- tool_id = _PyLong_AsInt(arg);
+ tool_id = PyLong_AsInt(arg);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -84,7 +84,7 @@ monitoring_get_tool(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int tool_id;
- tool_id = _PyLong_AsInt(arg);
+ tool_id = PyLong_AsInt(arg);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -117,11 +117,11 @@ monitoring_register_callback(PyObject *module, PyObject *const *args, Py_ssize_t
if (!_PyArg_CheckPositional("register_callback", nargs, 3, 3)) {
goto exit;
}
- tool_id = _PyLong_AsInt(args[0]);
+ tool_id = PyLong_AsInt(args[0]);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
- event = _PyLong_AsInt(args[1]);
+ event = PyLong_AsInt(args[1]);
if (event == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -150,7 +150,7 @@ monitoring_get_events(PyObject *module, PyObject *arg)
int tool_id;
int _return_value;
- tool_id = _PyLong_AsInt(arg);
+ tool_id = PyLong_AsInt(arg);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -185,11 +185,11 @@ monitoring_set_events(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (!_PyArg_CheckPositional("set_events", nargs, 2, 2)) {
goto exit;
}
- tool_id = _PyLong_AsInt(args[0]);
+ tool_id = PyLong_AsInt(args[0]);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
- event_set = _PyLong_AsInt(args[1]);
+ event_set = PyLong_AsInt(args[1]);
if (event_set == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -222,7 +222,7 @@ monitoring_get_local_events(PyObject *module, PyObject *const *args, Py_ssize_t
if (!_PyArg_CheckPositional("get_local_events", nargs, 2, 2)) {
goto exit;
}
- tool_id = _PyLong_AsInt(args[0]);
+ tool_id = PyLong_AsInt(args[0]);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -260,12 +260,12 @@ monitoring_set_local_events(PyObject *module, PyObject *const *args, Py_ssize_t
if (!_PyArg_CheckPositional("set_local_events", nargs, 3, 3)) {
goto exit;
}
- tool_id = _PyLong_AsInt(args[0]);
+ tool_id = PyLong_AsInt(args[0]);
if (tool_id == -1 && PyErr_Occurred()) {
goto exit;
}
code = args[1];
- event_set = _PyLong_AsInt(args[2]);
+ event_set = PyLong_AsInt(args[2]);
if (event_set == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -308,4 +308,4 @@ monitoring__all_events(PyObject *module, PyObject *Py_UNUSED(ignored))
{
return monitoring__all_events_impl(module);
}
-/*[clinic end generated code: output=11cc0803875b3ffa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8baabc8341df3f0e input=a9049054013a1b77]*/
diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h
index a593b98..102e637 100644
--- a/Python/clinic/marshal.c.h
+++ b/Python/clinic/marshal.c.h
@@ -48,7 +48,7 @@ marshal_dump(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (nargs < 3) {
goto skip_optional;
}
- version = _PyLong_AsInt(args[2]);
+ version = PyLong_AsInt(args[2]);
if (version == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -112,7 +112,7 @@ marshal_dumps(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (nargs < 2) {
goto skip_optional;
}
- version = _PyLong_AsInt(args[1]);
+ version = PyLong_AsInt(args[1]);
if (version == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -161,4 +161,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=12082d61d2942473 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0f4ecfd941293f67 input=a9049054013a1b77]*/
diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h
index a95a32f..1f751e4 100644
--- a/Python/clinic/sysmodule.c.h
+++ b/Python/clinic/sysmodule.c.h
@@ -444,7 +444,7 @@ sys_setrecursionlimit(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int new_limit;
- new_limit = _PyLong_AsInt(arg);
+ new_limit = PyLong_AsInt(arg);
if (new_limit == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -507,7 +507,7 @@ sys_set_coroutine_origin_tracking_depth(PyObject *module, PyObject *const *args,
if (!args) {
goto exit;
}
- depth = _PyLong_AsInt(args[0]);
+ depth = PyLong_AsInt(args[0]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -675,7 +675,7 @@ sys_setdlopenflags(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int new_val;
- new_val = _PyLong_AsInt(arg);
+ new_val = PyLong_AsInt(arg);
if (new_val == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -730,7 +730,7 @@ sys_mdebug(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
int flag;
- flag = _PyLong_AsInt(arg);
+ flag = PyLong_AsInt(arg);
if (flag == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -808,7 +808,7 @@ sys_set_int_max_str_digits(PyObject *module, PyObject *const *args, Py_ssize_t n
if (!args) {
goto exit;
}
- maxdigits = _PyLong_AsInt(args[0]);
+ maxdigits = PyLong_AsInt(args[0]);
if (maxdigits == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -969,7 +969,7 @@ sys__getframe(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
if (nargs < 1) {
goto skip_optional;
}
- depth = _PyLong_AsInt(args[0]);
+ depth = PyLong_AsInt(args[0]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -1358,7 +1358,7 @@ sys__getframemodulename(PyObject *module, PyObject *const *args, Py_ssize_t narg
if (!noptargs) {
goto skip_optional_pos;
}
- depth = _PyLong_AsInt(args[0]);
+ depth = PyLong_AsInt(args[0]);
if (depth == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -1412,4 +1412,4 @@ exit:
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=41937e0843c68009 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6de02cd7d925d1de input=a9049054013a1b77]*/
diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h
index 3c34493..1a0eaf9 100644
--- a/Python/clinic/traceback.c.h
+++ b/Python/clinic/traceback.c.h
@@ -65,11 +65,11 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
goto exit;
}
tb_frame = (PyFrameObject *)fastargs[1];
- tb_lasti = _PyLong_AsInt(fastargs[2]);
+ tb_lasti = PyLong_AsInt(fastargs[2]);
if (tb_lasti == -1 && PyErr_Occurred()) {
goto exit;
}
- tb_lineno = _PyLong_AsInt(fastargs[3]);
+ tb_lineno = PyLong_AsInt(fastargs[3]);
if (tb_lineno == -1 && PyErr_Occurred()) {
goto exit;
}
@@ -78,4 +78,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=7bc9927e362fdfb7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6303f910c04227a4 input=a9049054013a1b77]*/