diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-25 11:23:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-25 11:23:47 (GMT) |
commit | 32d96a2b5bc3136d45a66adbdb45fac351b520ce (patch) | |
tree | acf51c9945f764ab103597c9cba376f154aa600d /Modules/cjkcodecs | |
parent | 65ce60aef150776f884715b4315a10a0d6ae769e (diff) | |
download | cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.zip cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.gz cpython-32d96a2b5bc3136d45a66adbdb45fac351b520ce.tar.bz2 |
bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r-- | Modules/cjkcodecs/clinic/multibytecodec.c.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 74e45bd..1fef185 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -150,9 +150,11 @@ _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoder PyObject *return_value = NULL; PyLongObject *statelong; - if (!PyArg_Parse(arg, "O!:setstate", &PyLong_Type, &statelong)) { + if (!PyLong_Check(arg)) { + _PyArg_BadArgument("setstate", "int", arg); goto exit; } + statelong = (PyLongObject *)arg; return_value = _multibytecodec_MultibyteIncrementalEncoder_setstate_impl(self, statelong); exit: @@ -248,9 +250,11 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoder PyObject *return_value = NULL; PyObject *state; - if (!PyArg_Parse(arg, "O!:setstate", &PyTuple_Type, &state)) { + if (!PyTuple_Check(arg)) { + _PyArg_BadArgument("setstate", "tuple", arg); goto exit; } + state = arg; return_value = _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(self, state); exit: @@ -418,4 +422,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=4c1dc8015ee5abb4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a94364d0965adf1d input=a9049054013a1b77]*/ |