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/_dbmmodule.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/_dbmmodule.c')
-rw-r--r-- | Modules/_dbmmodule.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index d027e1c..24323aa 100644 --- a/Modules/_dbmmodule.c +++ b/Modules/_dbmmodule.c @@ -300,25 +300,26 @@ dbm_dbm_get(PyObject *self, PyObject *args) switch (PyTuple_GET_SIZE(args)) { case 1: if (!PyArg_ParseTuple(args, "s#:get", &key, &key_length)) - return NULL; + goto exit; break; case 2: if (!PyArg_ParseTuple(args, "s#O:get", &key, &key_length, &default_value)) - return NULL; + goto exit; group_right_1 = 1; break; default: PyErr_SetString(PyExc_TypeError, "dbm.dbm.get requires 1 to 2 arguments"); - return NULL; + goto exit; } return_value = dbm_dbm_get_impl((dbmobject *)self, key, key_length, group_right_1, default_value); +exit: return return_value; } static PyObject * dbm_dbm_get_impl(dbmobject *dp, const char *key, Py_ssize_clean_t key_length, int group_right_1, PyObject *default_value) -/*[clinic end generated code: checksum=2c3209571267017f1b9abbd19e1b521849fd5d4a]*/ +/*[clinic end generated code: checksum=ca8bf63ec226e71d3cf390749777f7d5b7361478]*/ { datum dbm_key, val; |