https://github.com/python/cpython/commit/5f14441114af4b8aadf45aa0dd764e43f5eedd5d
commit: 5f14441114af4b8aadf45aa0dd764e43f5eedd5d
branch: main
author: Shardul Deshpande <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-09-09T12:20:14+03:00
summary:

gh-157170: Restore use_env() after test_use_prescr_screen in test_curses 
(GH-157171)

curses.use_env() sets a process-wide ncurses setting, not a property of
the screen it is called on.

files:
M Lib/test/test_curses.py

diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index bbcf8d285a67743..7b059eb2e8e1414 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -3459,6 +3459,8 @@ def test_use_prescr_screen(self):
             with self.assertRaises(curses.error):
                 prescr.use(func)
         # Affecting the state before initscr() is what such a screen is for.
+        # use_env() is process-wide, not a property of this screen.
+        self.addCleanup(curses.use_env, True)
         prescr.use(lambda scr: curses.use_env(False))
         # The current screen is unchanged.
         screen.stdscr.refresh()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to