diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-09 13:16:06 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-06-09 13:16:06 (GMT) |
commit | 5dee6551e2b98792bc6336206f763623483e7883 (patch) | |
tree | e18dfc32e889ca62dc3a0d3f4cd1484353d7a6aa /Python/clinic | |
parent | 2561bf6ae0a16576321cfb8cb900869b109b2263 (diff) | |
download | cpython-5dee6551e2b98792bc6336206f763623483e7883.zip cpython-5dee6551e2b98792bc6336206f763623483e7883.tar.gz cpython-5dee6551e2b98792bc6336206f763623483e7883.tar.bz2 |
Issue #26305: Argument Clinic now uses braces in C code as required by PEP 7.
Diffstat (limited to 'Python/clinic')
-rw-r--r-- | Python/clinic/bltinmodule.c.h | 44 | ||||
-rw-r--r-- | Python/clinic/import.c.h | 29 |
2 files changed, 48 insertions, 25 deletions
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 90995e5..6df3ef5 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -94,8 +94,9 @@ builtin_format(PyModuleDef *module, PyObject *args) PyObject *format_spec = NULL; if (!PyArg_ParseTuple(args, "O|U:format", - &value, &format_spec)) + &value, &format_spec)) { goto exit; + } return_value = builtin_format_impl(module, value, format_spec); exit: @@ -120,8 +121,9 @@ builtin_chr(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; int i; - if (!PyArg_Parse(arg, "i:chr", &i)) + if (!PyArg_Parse(arg, "i:chr", &i)) { goto exit; + } return_value = builtin_chr_impl(module, i); exit: @@ -167,8 +169,9 @@ builtin_compile(PyModuleDef *module, PyObject *args, PyObject *kwargs) int optimize = -1; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO&s|iii:compile", _keywords, - &source, PyUnicode_FSDecoder, &filename, &mode, &flags, &dont_inherit, &optimize)) + &source, PyUnicode_FSDecoder, &filename, &mode, &flags, &dont_inherit, &optimize)) { goto exit; + } return_value = builtin_compile_impl(module, source, filename, mode, flags, dont_inherit, optimize); exit: @@ -196,8 +199,9 @@ builtin_divmod(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "divmod", 2, 2, - &x, &y)) + &x, &y)) { goto exit; + } return_value = builtin_divmod_impl(module, x, y); exit: @@ -233,8 +237,9 @@ builtin_eval(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "eval", 1, 3, - &source, &globals, &locals)) + &source, &globals, &locals)) { goto exit; + } return_value = builtin_eval_impl(module, source, globals, locals); exit: @@ -270,8 +275,9 @@ builtin_exec(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "exec", 1, 3, - &source, &globals, &locals)) + &source, &globals, &locals)) { goto exit; + } return_value = builtin_exec_impl(module, source, globals, locals); exit: @@ -322,8 +328,9 @@ builtin_hasattr(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "hasattr", 2, 2, - &obj, &name)) + &obj, &name)) { goto exit; + } return_value = builtin_hasattr_impl(module, obj, name); exit: @@ -367,8 +374,9 @@ builtin_setattr(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "setattr", 3, 3, - &obj, &name, &value)) + &obj, &name, &value)) { goto exit; + } return_value = builtin_setattr_impl(module, obj, name, value); exit: @@ -398,8 +406,9 @@ builtin_delattr(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "delattr", 2, 2, - &obj, &name)) + &obj, &name)) { goto exit; + } return_value = builtin_delattr_impl(module, obj, name); exit: @@ -507,8 +516,9 @@ builtin_pow(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "pow", 2, 3, - &x, &y, &z)) + &x, &y, &z)) { goto exit; + } return_value = builtin_pow_impl(module, x, y, z); exit: @@ -541,8 +551,9 @@ builtin_input(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "input", 0, 1, - &prompt)) + &prompt)) { goto exit; + } return_value = builtin_input_impl(module, prompt); exit: @@ -585,8 +596,9 @@ builtin_sum(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "sum", 1, 2, - &iterable, &start)) + &iterable, &start)) { goto exit; + } return_value = builtin_sum_impl(module, iterable, start); exit: @@ -619,8 +631,9 @@ builtin_isinstance(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "isinstance", 2, 2, - &obj, &class_or_tuple)) + &obj, &class_or_tuple)) { goto exit; + } return_value = builtin_isinstance_impl(module, obj, class_or_tuple); exit: @@ -653,11 +666,12 @@ builtin_issubclass(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "issubclass", 2, 2, - &cls, &class_or_tuple)) + &cls, &class_or_tuple)) { goto exit; + } return_value = builtin_issubclass_impl(module, cls, class_or_tuple); exit: return return_value; } -/*[clinic end generated code: output=4bef16b6aa432879 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=940f25126caf8166 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 2477665..9b9f812 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -89,8 +89,9 @@ _imp__fix_co_filename(PyModuleDef *module, PyObject *args) PyObject *path; if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename", - &PyCode_Type, &code, &path)) + &PyCode_Type, &code, &path)) { goto exit; + } return_value = _imp__fix_co_filename_impl(module, code, path); exit: @@ -142,8 +143,9 @@ _imp_init_frozen(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyArg_Parse(arg, "U:init_frozen", &name)) + if (!PyArg_Parse(arg, "U:init_frozen", &name)) { goto exit; + } return_value = _imp_init_frozen_impl(module, name); exit: @@ -168,8 +170,9 @@ _imp_get_frozen_object(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) + if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) { goto exit; + } return_value = _imp_get_frozen_object_impl(module, name); exit: @@ -194,8 +197,9 @@ _imp_is_frozen_package(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) + if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) { goto exit; + } return_value = _imp_is_frozen_package_impl(module, name); exit: @@ -220,8 +224,9 @@ _imp_is_builtin(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyArg_Parse(arg, "U:is_builtin", &name)) + if (!PyArg_Parse(arg, "U:is_builtin", &name)) { goto exit; + } return_value = _imp_is_builtin_impl(module, name); exit: @@ -246,8 +251,9 @@ _imp_is_frozen(PyModuleDef *module, PyObject *arg) PyObject *return_value = NULL; PyObject *name; - if (!PyArg_Parse(arg, "U:is_frozen", &name)) + if (!PyArg_Parse(arg, "U:is_frozen", &name)) { goto exit; + } return_value = _imp_is_frozen_impl(module, name); exit: @@ -277,8 +283,9 @@ _imp_create_dynamic(PyModuleDef *module, PyObject *args) if (!PyArg_UnpackTuple(args, "create_dynamic", 1, 2, - &spec, &file)) + &spec, &file)) { goto exit; + } return_value = _imp_create_dynamic_impl(module, spec, file); exit: @@ -308,8 +315,9 @@ _imp_exec_dynamic(PyModuleDef *module, PyObject *mod) int _return_value; _return_value = _imp_exec_dynamic_impl(module, mod); - if ((_return_value == -1) && PyErr_Occurred()) + if ((_return_value == -1) && PyErr_Occurred()) { goto exit; + } return_value = PyLong_FromLong((long)_return_value); exit: @@ -337,8 +345,9 @@ _imp_exec_builtin(PyModuleDef *module, PyObject *mod) int _return_value; _return_value = _imp_exec_builtin_impl(module, mod); - if ((_return_value == -1) && PyErr_Occurred()) + if ((_return_value == -1) && PyErr_Occurred()) { goto exit; + } return_value = PyLong_FromLong((long)_return_value); exit: @@ -352,4 +361,4 @@ exit: #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=32324a5e46cdfc4b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=22a7225925755674 input=a9049054013a1b77]*/ |