Skip to content

Commit c889ff6

Browse files
[3.14] gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) (GH-143459)
(cherry picked from commit 04ace41) Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
1 parent dbf0824 commit c889ff6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,6 +1981,17 @@ def test_no_newline(self):
19811981
safe_patterns.append(r'\x1b\[\?25[hl]') # cursor visibility
19821982
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking
19831983

1984+
# rmam / smam - automatic margins
1985+
rmam = ti.get("rmam")
1986+
smam = ti.get("smam")
1987+
if rmam:
1988+
safe_patterns.append(re.escape(rmam.decode("ascii")))
1989+
if smam:
1990+
safe_patterns.append(re.escape(smam.decode("ascii")))
1991+
if not rmam and not smam:
1992+
safe_patterns.append(r'\x1b\[\?7l') # turn off automatic margins
1993+
safe_patterns.append(r'\x1b\[\?7h') # turn on automatic margins
1994+
19841995
# Modern extensions not in standard terminfo - always use patterns
19851996
safe_patterns.append(r'\x1b\[\?2004[hl]') # bracketed paste mode
19861997
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking (may be separate)

0 commit comments

Comments
 (0)