diff options
author | Larry Hastings <larry@hastings.org> | 2014-01-22 11:05:49 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-01-22 11:05:49 (GMT) |
commit | 462582651c92dad3d0e50810075d53d4a04e2466 (patch) | |
tree | 8306867e6d7c27d4fda979bde24aef0869015abd /Modules/zlibmodule.c | |
parent | 071baa63c4ea3a54a54d90b173dd777e08895976 (diff) | |
download | cpython-462582651c92dad3d0e50810075d53d4a04e2466.zip cpython-462582651c92dad3d0e50810075d53d4a04e2466.tar.gz cpython-462582651c92dad3d0e50810075d53d4a04e2466.tar.bz2 |
Two minor Argument Clinic bugfixes: use the name of the class in the
docstring for __new__ and __init__, and always use "goto exit" instead of
returning "NULL" for failure to parse (as _new__ and __init__ return ints).
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r-- | Modules/zlibmodule.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index efa95e9..3894296 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -205,19 +205,20 @@ zlib_compress(PyModuleDef *module, PyObject *args) switch (PyTuple_GET_SIZE(args)) { case 1: if (!PyArg_ParseTuple(args, "y*:compress", &bytes)) - return NULL; + goto exit; break; case 2: if (!PyArg_ParseTuple(args, "y*i:compress", &bytes, &level)) - return NULL; + goto exit; group_right_1 = 1; break; default: PyErr_SetString(PyExc_TypeError, "zlib.compress requires 1 to 2 arguments"); - return NULL; + goto exit; } return_value = zlib_compress_impl(module, &bytes, group_right_1, level); +exit: /* Cleanup for bytes */ if (bytes.obj) PyBuffer_Release(&bytes); @@ -227,7 +228,7 @@ zlib_compress(PyModuleDef *module, PyObject *args) static PyObject * zlib_compress_impl(PyModuleDef *module, Py_buffer *bytes, int group_right_1, int level) -/*[clinic end generated code: checksum=66c4d16d0b8b9dd423648d9ef00d6a89d3363665]*/ +/*[clinic end generated code: checksum=74648f97e6b9d3cc9cd568d47262d462bded7ed0]*/ { PyObject *ReturnVal = NULL; Byte *input, *output = NULL; |