]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-154786: Fix crashes on a screen without a terminal (GH-154787)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 28 Jul 2026 05:00:39 +0000 (08:00 +0300)
committerGitHub <noreply@github.com>
Tue, 28 Jul 2026 05:00:39 +0000 (08:00 +0300)
commitc8eb79d5e89196449992fe50978d6b8845dc6681
treed83283278f7851c0af4b74418d2c5d251dc4ea5f
parent22a123f1305bf45d5d35441e9164fb4528da493c
gh-154786: Fix crashes on a screen without a terminal (GH-154787)

screen.use() makes its screen current for the callback, so a new_prescr()
screen, which has no terminal, can be current without set_term().
Operations that need a terminal then crashed inside curses.

Raise curses.error instead, checking that stdscr exists.
Lib/test/test_curses.py
Modules/_cursesmodule.c