mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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
6
Objects/clinic/bytearrayobject.c.h
generated
6
Objects/clinic/bytearrayobject.c.h
generated
|
|
@ -1203,7 +1203,7 @@ bytearray_hex(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nargs,
|
|||
goto skip_optional_pos;
|
||||
}
|
||||
}
|
||||
bytes_per_sep = _PyLong_AsInt(args[1]);
|
||||
bytes_per_sep = PyLong_AsInt(args[1]);
|
||||
if (bytes_per_sep == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -1256,7 +1256,7 @@ bytearray_reduce_ex(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t n
|
|||
if (nargs < 1) {
|
||||
goto skip_optional;
|
||||
}
|
||||
proto = _PyLong_AsInt(args[0]);
|
||||
proto = PyLong_AsInt(args[0]);
|
||||
if (proto == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -1284,4 +1284,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return bytearray_sizeof_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=0817195f176cd8e3 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=cb94d7ac45f0a4b7 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
4
Objects/clinic/bytesobject.c.h
generated
4
Objects/clinic/bytesobject.c.h
generated
|
|
@ -958,7 +958,7 @@ bytes_hex(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject
|
|||
goto skip_optional_pos;
|
||||
}
|
||||
}
|
||||
bytes_per_sep = _PyLong_AsInt(args[1]);
|
||||
bytes_per_sep = PyLong_AsInt(args[1]);
|
||||
if (bytes_per_sep == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -1060,4 +1060,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=bc4801bf1fa628f4 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=f4e85363c79c64d3 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
32
Objects/clinic/codeobject.c.h
generated
32
Objects/clinic/codeobject.c.h
generated
|
|
@ -57,27 +57,27 @@ code_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
if (!_PyArg_CheckPositional("code", PyTuple_GET_SIZE(args), 16, 18)) {
|
||||
goto exit;
|
||||
}
|
||||
argcount = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0));
|
||||
argcount = PyLong_AsInt(PyTuple_GET_ITEM(args, 0));
|
||||
if (argcount == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
posonlyargcount = _PyLong_AsInt(PyTuple_GET_ITEM(args, 1));
|
||||
posonlyargcount = PyLong_AsInt(PyTuple_GET_ITEM(args, 1));
|
||||
if (posonlyargcount == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
kwonlyargcount = _PyLong_AsInt(PyTuple_GET_ITEM(args, 2));
|
||||
kwonlyargcount = PyLong_AsInt(PyTuple_GET_ITEM(args, 2));
|
||||
if (kwonlyargcount == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
nlocals = _PyLong_AsInt(PyTuple_GET_ITEM(args, 3));
|
||||
nlocals = PyLong_AsInt(PyTuple_GET_ITEM(args, 3));
|
||||
if (nlocals == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
stacksize = _PyLong_AsInt(PyTuple_GET_ITEM(args, 4));
|
||||
stacksize = PyLong_AsInt(PyTuple_GET_ITEM(args, 4));
|
||||
if (stacksize == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
flags = _PyLong_AsInt(PyTuple_GET_ITEM(args, 5));
|
||||
flags = PyLong_AsInt(PyTuple_GET_ITEM(args, 5));
|
||||
if (flags == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ code_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
goto exit;
|
||||
}
|
||||
qualname = PyTuple_GET_ITEM(args, 12);
|
||||
firstlineno = _PyLong_AsInt(PyTuple_GET_ITEM(args, 13));
|
||||
firstlineno = PyLong_AsInt(PyTuple_GET_ITEM(args, 13));
|
||||
if (firstlineno == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -231,7 +231,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
goto skip_optional_kwonly;
|
||||
}
|
||||
if (args[0]) {
|
||||
co_argcount = _PyLong_AsInt(args[0]);
|
||||
co_argcount = PyLong_AsInt(args[0]);
|
||||
if (co_argcount == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -240,7 +240,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (args[1]) {
|
||||
co_posonlyargcount = _PyLong_AsInt(args[1]);
|
||||
co_posonlyargcount = PyLong_AsInt(args[1]);
|
||||
if (co_posonlyargcount == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -249,7 +249,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (args[2]) {
|
||||
co_kwonlyargcount = _PyLong_AsInt(args[2]);
|
||||
co_kwonlyargcount = PyLong_AsInt(args[2]);
|
||||
if (co_kwonlyargcount == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -258,7 +258,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (args[3]) {
|
||||
co_nlocals = _PyLong_AsInt(args[3]);
|
||||
co_nlocals = PyLong_AsInt(args[3]);
|
||||
if (co_nlocals == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -267,7 +267,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (args[4]) {
|
||||
co_stacksize = _PyLong_AsInt(args[4]);
|
||||
co_stacksize = PyLong_AsInt(args[4]);
|
||||
if (co_stacksize == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (args[5]) {
|
||||
co_flags = _PyLong_AsInt(args[5]);
|
||||
co_flags = PyLong_AsInt(args[5]);
|
||||
if (co_flags == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje
|
|||
}
|
||||
}
|
||||
if (args[6]) {
|
||||
co_firstlineno = _PyLong_AsInt(args[6]);
|
||||
co_firstlineno = PyLong_AsInt(args[6]);
|
||||
if (co_firstlineno == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -455,7 +455,7 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n
|
|||
if (!args) {
|
||||
goto exit;
|
||||
}
|
||||
oparg = _PyLong_AsInt(args[0]);
|
||||
oparg = PyLong_AsInt(args[0]);
|
||||
if (oparg == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -464,4 +464,4 @@ code__varname_from_oparg(PyCodeObject *self, PyObject *const *args, Py_ssize_t n
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=16c95266bbc4bc03 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=0446968a1fbd13b2 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
6
Objects/clinic/memoryobject.c.h
generated
6
Objects/clinic/memoryobject.c.h
generated
|
|
@ -112,7 +112,7 @@ memoryview__from_flags(PyTypeObject *type, PyObject *const *args, Py_ssize_t nar
|
|||
goto exit;
|
||||
}
|
||||
object = args[0];
|
||||
flags = _PyLong_AsInt(args[1]);
|
||||
flags = PyLong_AsInt(args[1]);
|
||||
if (flags == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -403,7 +403,7 @@ memoryview_hex(PyMemoryViewObject *self, PyObject *const *args, Py_ssize_t nargs
|
|||
goto skip_optional_pos;
|
||||
}
|
||||
}
|
||||
bytes_per_sep = _PyLong_AsInt(args[1]);
|
||||
bytes_per_sep = PyLong_AsInt(args[1]);
|
||||
if (bytes_per_sep == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -413,4 +413,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=a4f6992947bcaf25 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=28a632db32b44b63 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
4
Objects/clinic/typeobject.c.h
generated
4
Objects/clinic/typeobject.c.h
generated
|
|
@ -190,7 +190,7 @@ object___reduce_ex__(PyObject *self, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
int protocol;
|
||||
|
||||
protocol = _PyLong_AsInt(arg);
|
||||
protocol = PyLong_AsInt(arg);
|
||||
if (protocol == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -266,4 +266,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return object___dir___impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=43533e6981550e9e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=baf5ec2093815a3f input=a9049054013a1b77]*/
|
||||
|
|
|
|||
4
Objects/clinic/unicodeobject.c.h
generated
4
Objects/clinic/unicodeobject.c.h
generated
|
|
@ -289,7 +289,7 @@ unicode_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb
|
|||
if (!noptargs) {
|
||||
goto skip_optional_pos;
|
||||
}
|
||||
tabsize = _PyLong_AsInt(args[0]);
|
||||
tabsize = PyLong_AsInt(args[0]);
|
||||
if (tabsize == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -1504,4 +1504,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=ee76a1b49cd4cbb3 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=2e1e1b136ef1b681 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ stringlib_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, Py
|
|||
if (!noptargs) {
|
||||
goto skip_optional_pos;
|
||||
}
|
||||
tabsize = _PyLong_AsInt(args[0]);
|
||||
tabsize = PyLong_AsInt(args[0]);
|
||||
if (tabsize == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -278,4 +278,4 @@ stringlib_zfill(PyObject *self, PyObject *arg)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=d44a269805f6739e input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=00e34c03331699fe input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue