mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)
Argument Clinic now uses the new public PyLong_AsInt(), rather than the old name _PyLong_AsInt().
This commit is contained in:
parent
be800f4be7
commit
4e5a7284ee
73 changed files with 467 additions and 466 deletions
4
Python/clinic/_warnings.c.h
generated
4
Python/clinic/_warnings.c.h
generated
|
@ -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]*/
|
||||
|
|
12
Python/clinic/bltinmodule.c.h
generated
12
Python/clinic/bltinmodule.c.h
generated
|
@ -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]*/
|
||||
|
|
6
Python/clinic/import.c.h
generated
6
Python/clinic/import.c.h
generated
|
@ -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]*/
|
||||
|
|
24
Python/clinic/instrumentation.c.h
generated
24
Python/clinic/instrumentation.c.h
generated
|
@ -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]*/
|
||||
|
|
6
Python/clinic/marshal.c.h
generated
6
Python/clinic/marshal.c.h
generated
|
@ -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]*/
|
||||
|
|
16
Python/clinic/sysmodule.c.h
generated
16
Python/clinic/sysmodule.c.h
generated
|
@ -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]*/
|
||||
|
|
6
Python/clinic/traceback.c.h
generated
6
Python/clinic/traceback.c.h
generated
|
@ -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]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue