mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +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
37
Python/clinic/import.c.h
generated
37
Python/clinic/import.c.h
generated
|
|
@ -143,9 +143,14 @@ _imp_init_frozen(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:init_frozen", &name)) {
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("init_frozen", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_init_frozen_impl(module, name);
|
||||
|
||||
exit:
|
||||
|
|
@ -170,9 +175,14 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) {
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("get_frozen_object", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_get_frozen_object_impl(module, name);
|
||||
|
||||
exit:
|
||||
|
|
@ -197,9 +207,14 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) {
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("is_frozen_package", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_is_frozen_package_impl(module, name);
|
||||
|
||||
exit:
|
||||
|
|
@ -224,9 +239,14 @@ _imp_is_builtin(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:is_builtin", &name)) {
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("is_builtin", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_is_builtin_impl(module, name);
|
||||
|
||||
exit:
|
||||
|
|
@ -251,9 +271,14 @@ _imp_is_frozen(PyObject *module, PyObject *arg)
|
|||
PyObject *return_value = NULL;
|
||||
PyObject *name;
|
||||
|
||||
if (!PyArg_Parse(arg, "U:is_frozen", &name)) {
|
||||
if (!PyUnicode_Check(arg)) {
|
||||
_PyArg_BadArgument("is_frozen", "str", arg);
|
||||
goto exit;
|
||||
}
|
||||
if (PyUnicode_READY(arg) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
name = arg;
|
||||
return_value = _imp_is_frozen_impl(module, name);
|
||||
|
||||
exit:
|
||||
|
|
@ -396,4 +421,4 @@ exit:
|
|||
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#define _IMP_EXEC_DYNAMIC_METHODDEF
|
||||
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
|
||||
/*[clinic end generated code: output=ad747b76e105fff2 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d8be58c9541122f1 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue