]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-154055: Gate optional curses functions absent on old SVr4 curses (GH-154057)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 19 Jul 2026 12:26:47 +0000 (15:26 +0300)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 12:26:47 +0000 (15:26 +0300)
commit104c397d8f1eeb3649d0c676eec95cd0c9c3f7ce
tree2d35939cf558efa359b339262a1d271f1b2d0860
parentee50ed3ed010e26495300778b30b57da5cadc933
gh-154055: Gate optional curses functions absent on old SVr4 curses (GH-154057)

Build hygiene so the curses modules build against a limited curses (e.g. the
native SVr4 curses of illumos/Solaris), matching how other optional functions
are already gated:

* Probe and #ifdef-gate the X/Open attr_t functions (window.attr_get/attr_set/
  attr_on/attr_off/color_set), the soft-label attribute functions
  (slk_attr_on/off/set, slk_color) and scr_set(); scr_set is probed separately
  from the scr_dump family, which SVr4 has without it.
* Stop gating update_lines_cols() on resizeterm(): it only reads LINES/COLS and
  is used unconditionally (e.g. by set_term()), so a build without resizeterm()
  failed to link.
* On Solaris/illumos define _BOOL (and include <stdbool.h>) so the SVr4
  <curses.h> "typedef char bool" does not clash with C's bool.

test.test_curses: skip or guard the tests that use the now-optional functions,
split test_attributes so its chtype-based part still runs, and treat the native
curses of NetBSD and illumos/Solaris as having broken newterm() (they crash on
repeated newterm()/delscreen(), like ncurses before 6.5).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Include/py_curses.h
Lib/test/test_curses.py
Misc/NEWS.d/next/Build/2026-07-19-07-48-43.gh-issue-154055.FemUJU.rst [new file with mode: 0644]
Modules/_cursesmodule.c
Modules/clinic/_cursesmodule.c.h
configure
configure.ac
pyconfig.h.in