]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-152813: Fix curses build warning on macOS (GH-152814)
authorAndrii Hrimov <andrew.hrimov@gmail.com>
Thu, 2 Jul 2026 15:38:41 +0000 (17:38 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2026 15:38:41 +0000 (18:38 +0300)
Modules/_cursesmodule.c

index 6fc671cc6c6803661b36a2ef7e2f4140e3ae515d..03e399b252fcfb25898e5bfbc1b0c21d7d84faee 100644 (file)
@@ -3137,7 +3137,8 @@ _curses_window_getbkgrnd_impl(PyCursesWindowObject *self)
     curses_cell_t wcval = {0};
     cursesmodule_state *state = get_cursesmodule_state_by_win(self);
 #ifdef HAVE_NCURSESW
-    if (wgetbkgrnd(self->win, &wcval) == ERR) {
+    int rtn = wgetbkgrnd(self->win, &wcval);  /* avoid -Wunreachable-code on macOS */
+    if (rtn == ERR) {
         curses_window_set_error(self, "wgetbkgrnd", "getbkgrnd");
         return NULL;
     }