Skip to content

Commit 74273cc

Browse files
committed
Fix curses build warning on macOS
1 parent f21f338 commit 74273cc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/_cursesmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3137,7 +3137,8 @@ _curses_window_getbkgrnd_impl(PyCursesWindowObject *self)
31373137
curses_cell_t wcval = {0};
31383138
cursesmodule_state *state = get_cursesmodule_state_by_win(self);
31393139
#ifdef HAVE_NCURSESW
3140-
if (wgetbkgrnd(self->win, &wcval) == ERR) {
3140+
int rtn = wgetbkgrnd(self->win, &wcval); /* avoid -Wunreachable-code on macOS */
3141+
if (rtn == ERR) {
31413142
curses_window_set_error(self, "wgetbkgrnd", "getbkgrnd");
31423143
return NULL;
31433144
}

0 commit comments

Comments
 (0)