Skip to content

Commit 4d8f47f

Browse files
committed
reduce diff again!
1 parent 92e62cf commit 4d8f47f

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

Modules/_cursesmodule.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,6 @@ _curses_window_addstr_impl(PyCursesWindowObject *self, int group_left_1,
10761076
if (strtype == 0) {
10771077
return NULL;
10781078
}
1079-
10801079
if (use_attr) {
10811080
attr_old = getattrs(self->win);
10821081
(void)wattrset(self->win,attr);
@@ -1406,7 +1405,7 @@ _curses_window_box_impl(PyCursesWindowObject *self, int group_right_1,
14061405
return NULL;
14071406
}
14081407
}
1409-
(void)box(self->win, ch1, ch2);
1408+
(void)box(self->win,ch1,ch2);
14101409
Py_RETURN_NONE;
14111410
}
14121411

@@ -1504,15 +1503,14 @@ PyCursesWindow_ChgAt(PyObject *op, PyObject *args)
15041503
attr = attr & A_ATTRIBUTES;
15051504

15061505
if (use_xy) {
1507-
rtn = mvwchgat(self->win, y, x, num, attr, color, NULL);
1506+
rtn = mvwchgat(self->win,y,x,num,attr,color,NULL);
15081507
curses_funcname = "mvwchgat";
1509-
(void)touchline(self->win, y, 1);
1510-
}
1511-
else {
1512-
getyx(self->win, y, x);
1513-
rtn = wchgat(self->win, num, attr, color, NULL);
1508+
(void)touchline(self->win,y,1);
1509+
} else {
1510+
getyx(self->win,y,x);
1511+
rtn = wchgat(self->win,num,attr,color,NULL);
15141512
curses_funcname = "wchgat";
1515-
(void)touchline(self->win, y, 1);
1513+
(void)touchline(self->win,y,1);
15161514
}
15171515
return PyCursesCheckERR_ForWin_From(self, rtn, "chgat", curses_funcname);
15181516
}
@@ -1788,7 +1786,7 @@ _curses_window_get_wch_impl(PyCursesWindowObject *self, int group_right_1,
17881786

17891787
Py_BEGIN_ALLOW_THREADS
17901788
if (!group_right_1) {
1791-
ct = wget_wch(self->win, &rtn);
1789+
ct = wget_wch(self->win ,&rtn);
17921790
}
17931791
else {
17941792
ct = mvwget_wch(self->win, y, x, &rtn);
@@ -3761,17 +3759,13 @@ _curses_setupterm_impl(PyObject *module, const char *term, int fd)
37613759
}
37623760

37633761
if (!curses_setupterm_called && setupterm((char *)term, fd, &err) == ERR) {
3764-
const char *s;
3762+
const char *s = "setupterm: unknown error";
37653763

37663764
if (err == 0) {
37673765
s = "setupterm: could not find terminal";
3768-
}
3769-
else if (err == -1) {
3766+
} else if (err == -1) {
37703767
s = "setupterm: could not find terminfo database";
37713768
}
3772-
else {
3773-
s = "setupterm: unknown error";
3774-
}
37753769

37763770
cursesmodule_state *state = get_cursesmodule_state(module);
37773771
PyErr_SetString(state->error, s);

0 commit comments

Comments
 (0)