Skip to content

Commit 369ce43

Browse files
authored
gh-152813: Fix curses build warning on macOS (GH-152814)
1 parent 311e7e7 commit 369ce43

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)