https://github.com/python/cpython/commit/c889ff6ba5ddd4c42ba0dc56a2944c4c109654ae
commit: c889ff6ba5ddd4c42ba0dc56a2944c4c109654ae
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: ambv <[email protected]>
date: 2026-01-05T23:20:51+01:00
summary:

[3.14] gh-143394: filter for turning off automatic margins in test_no_newline 
(GH-143433) (GH-143459)

(cherry picked from commit 04ace41fe2cf648be433503d0c336b154ad63a3b)

Co-authored-by: Chris Eibl <[email protected]>

files:
M Lib/test/test_pyrepl/test_pyrepl.py

diff --git a/Lib/test/test_pyrepl/test_pyrepl.py 
b/Lib/test/test_pyrepl/test_pyrepl.py
index b1c6e5c99696da..9c365007bebcc9 100644
--- a/Lib/test/test_pyrepl/test_pyrepl.py
+++ b/Lib/test/test_pyrepl/test_pyrepl.py
@@ -1981,6 +1981,17 @@ def test_no_newline(self):
             safe_patterns.append(r'\x1b\[\?25[hl]')  # cursor visibility
             safe_patterns.append(r'\x1b\[\?12[hl]')  # cursor blinking
 
+        # rmam / smam - automatic margins
+        rmam = ti.get("rmam")
+        smam = ti.get("smam")
+        if rmam:
+            safe_patterns.append(re.escape(rmam.decode("ascii")))
+        if smam:
+            safe_patterns.append(re.escape(smam.decode("ascii")))
+        if not rmam and not smam:
+            safe_patterns.append(r'\x1b\[\?7l') # turn off automatic margins
+            safe_patterns.append(r'\x1b\[\?7h') # turn on automatic margins
+
         # Modern extensions not in standard terminfo - always use patterns
         safe_patterns.append(r'\x1b\[\?2004[hl]')  # bracketed paste mode
         safe_patterns.append(r'\x1b\[\?12[hl]')  # cursor blinking (may be 
separate)

_______________________________________________
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