]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154395: Skip test_environment_is_not_modified without rl_change_environment (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 04:25:24 +0000 (07:25 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 04:25:24 +0000 (04:25 +0000)
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 <noreply@anthropic.com>
Lib/test/test_readline.py

index b0b9d64cfe6a5f7a0b94b2ca241c0cfa7ef96838..97ca93ae09db343c5a0057203a56de0572a57037 100644 (file)
@@ -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.