From 4bf047fcfe0a7a822ecf0f26cc87478b90379020 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 21 Jul 2026 21:08:16 +0300 Subject: [PATCH] gh-154395: Skip test_environment_is_not_modified without rl_change_environment 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 --- Lib/test/test_readline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py index b0b9d64cfe6a5f..97ca93ae09db34 100644 --- a/Lib/test/test_readline.py +++ b/Lib/test/test_readline.py @@ -5,6 +5,7 @@ import locale import os import sys +import sysconfig import tempfile import textwrap import threading @@ -413,6 +414,8 @@ def test_write_read_limited_history(self): # 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.