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/clinic/_bz2module.c.h | |
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/clinic/_bz2module.c.h')
-rw-r--r-- | Modules/clinic/_bz2module.c.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index f538719..dce746d 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -25,7 +25,11 @@ _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg) PyObject *return_value = NULL; Py_buffer data = {NULL, NULL}; - if (!PyArg_Parse(arg, "y*:compress", &data)) { + if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&data, 'C')) { + _PyArg_BadArgument("compress", "contiguous buffer", arg); goto exit; } return_value = _bz2_BZ2Compressor_compress_impl(self, &data); @@ -174,4 +178,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e47f4255d265b07d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8549cccdb82f57d9 input=a9049054013a1b77]*/ |