From: Serhiy Storchaka Date: Wed, 22 Jul 2026 04:25:24 +0000 (+0300) Subject: gh-154395: Skip test_environment_is_not_modified without rl_change_environment (GH... X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=0e4940f0c113d8f4522ca3c120e470e9da922a8d;p=thirdparty%2FPython%2Fcpython.git gh-154395: Skip test_environment_is_not_modified without rl_change_environment (GH-154396) readline sets LINES and COLUMNS if rl_change_environment is not available, which is the case with readline older than 6.3. Co-authored-by: Claude Opus 4.8 --- diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py index b0b9d64cfe6a..97ca93ae09db 100644 --- a/Lib/test/test_readline.py +++ b/Lib/test/test_readline.py @@ -5,6 +5,7 @@ import codecs import locale import os import sys +import sysconfig import tempfile import textwrap import threading @@ -413,6 +414,8 @@ readline.write_history_file(history_file) # So, we've only tested that the read did not fail. # See TestHistoryManipulation for the full test. + @unittest.skipUnless(sysconfig.get_config_var("HAVE_RL_CHANGE_ENVIRONMENT"), + "readline can modify the environment") def test_environment_is_not_modified(self): # os.environ contains environment at the time "os" module was loaded, so # before the "readline" module is loaded.