summaryrefslogtreecommitdiff
path: root/Modules/_cursesmodule.c
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-01-22 03:05:49 -0800
committerLarry Hastings <larry@hastings.org>2014-01-22 03:05:49 -0800
commit462582651c92dad3d0e50810075d53d4a04e2466 (patch)
tree8306867e6d7c27d4fda979bde24aef0869015abd /Modules/_cursesmodule.c
parent071baa63c4ea3a54a54d90b173dd777e08895976 (diff)
downloadcpython-git-462582651c92dad3d0e50810075d53d4a04e2466.tar.gz
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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index a1dc9eb967..f81fabb09f 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;