diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-01-11 14:01:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-11 14:01:14 (GMT) |
commit | 4fa9591025b6a098f3d6402e5413ee6740ede6c5 (patch) | |
tree | a81280fdd40c6a5b8c00613b0a8903624499afc5 /Modules/clinic/_lzmamodule.c.h | |
parent | 5485085b324a45307c1ff4ec7d85b5998d7d5e0d (diff) | |
download | cpython-4fa9591025b6a098f3d6402e5413ee6740ede6c5.zip cpython-4fa9591025b6a098f3d6402e5413ee6740ede6c5.tar.gz cpython-4fa9591025b6a098f3d6402e5413ee6740ede6c5.tar.bz2 |
bpo-35582: Argument Clinic: inline parsing code for positional parameters. (GH-11313)
Diffstat (limited to 'Modules/clinic/_lzmamodule.c.h')
-rw-r--r-- | Modules/clinic/_lzmamodule.c.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index 46d2988..aeb98a6 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -29,7 +29,7 @@ _lzma_LZMACompressor_compress(Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, "contiguous buffer", arg); goto exit; } return_value = _lzma_LZMACompressor_compress_impl(self, &data); @@ -252,8 +252,17 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz lzma_vli filter_id; Py_buffer encoded_props = {NULL, NULL}; - if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties", - lzma_vli_converter, &filter_id, &encoded_props)) { + if (!_PyArg_CheckPositional("_decode_filter_properties", nargs, 2, 2)) { + goto exit; + } + if (!lzma_vli_converter(args[0], &filter_id)) { + goto exit; + } + if (PyObject_GetBuffer(args[1], &encoded_props, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&encoded_props, 'C')) { + _PyArg_BadArgument("_decode_filter_properties", 2, "contiguous buffer", args[1]); goto exit; } return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props); @@ -266,4 +275,4 @@ exit: return return_value; } -/*[clinic end generated code: output=df061bfc2067a90a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=47e4732df79509ad input=a9049054013a1b77]*/ |