mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
This commit is contained in:
parent
65ce60aef1
commit
32d96a2b5b
49 changed files with 1677 additions and 275 deletions
10
Python/clinic/bltinmodule.c.h
generated
10
Python/clinic/bltinmodule.c.h
generated
|
@ -122,7 +122,13 @@ builtin_chr(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
int i;
|
||||
|
||||
if (!PyArg_Parse(arg, "i:chr", &i)) {
|
||||
if (PyFloat_Check(arg)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"integer argument expected, got float" );
|
||||
goto exit;
|
||||
}
|
||||
i = _PyLong_AsInt(arg);
|
||||
if (i == -1 && PyErr_Occurred()) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = builtin_chr_impl(module, i);
|
||||
|
@ -711,4 +717,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=fa8d97ac8695363b input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=ed300ebf3f6db530 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue