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/_cursesmodule.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/_cursesmodule.c')
-rw-r--r-- | Modules/_cursesmodule.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index a1dc9eb..f81fabb 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -621,36 +621,37 @@ curses_window_addch(PyObject *self, PyObject *args) switch (PyTuple_GET_SIZE(args)) { case 1: if (!PyArg_ParseTuple(args, "O:addch", &ch)) - return NULL; + goto exit; break; case 2: if (!PyArg_ParseTuple(args, "Ol:addch", &ch, &attr)) - return NULL; + goto exit; group_right_1 = 1; break; case 3: if (!PyArg_ParseTuple(args, "iiO:addch", &x, &y, &ch)) - return NULL; + goto exit; group_left_1 = 1; break; case 4: if (!PyArg_ParseTuple(args, "iiOl:addch", &x, &y, &ch, &attr)) - return NULL; + goto exit; group_right_1 = 1; group_left_1 = 1; break; default: PyErr_SetString(PyExc_TypeError, "curses.window.addch requires 1 to 4 arguments"); - return NULL; + goto exit; } return_value = curses_window_addch_impl(self, group_left_1, x, y, ch, group_right_1, attr); +exit: return return_value; } static PyObject * curses_window_addch_impl(PyObject *self, int group_left_1, int x, int y, PyObject *ch, int group_right_1, long attr) -/*[clinic end generated code: checksum=b073327add8197b6ba7fb96c87062422c8312954]*/ +/*[clinic end generated code: checksum=53d44d79791b30950972b3256bdd464f7426bf82]*/ { PyCursesWindowObject *cwself = (PyCursesWindowObject *)self; int coordinates_group = group_left_1; |