Skip to content

Commit 65bc994

Browse files
chris-eiblmiss-islington
authored andcommitted
pythongh-143394: filter for turning off automatic margins in test_no_newline (pythonGH-143433)
(cherry picked from commit 04ace41) Co-authored-by: Chris Eibl <[email protected]>
1 parent f2665b6 commit 65bc994

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
@@ -1465,6 +1465,17 @@ def test_no_newline(self):
14651465
safe_patterns.append(r'\x1b\[\?25[hl]') # cursor visibility
14661466
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking
14671467

1468+
# rmam / smam - automatic margins
1469+
rmam = ti.get("rmam")
1470+
smam = ti.get("smam")
1471+
if rmam:
1472+
safe_patterns.append(re.escape(rmam.decode("ascii")))
1473+
if smam:
1474+
safe_patterns.append(re.escape(smam.decode("ascii")))
1475+
if not rmam and not smam:
1476+
safe_patterns.append(r'\x1b\[\?7l') # turn off automatic margins
1477+
safe_patterns.append(r'\x1b\[\?7h') # turn on automatic margins
1478+
14681479
# Modern extensions not in standard terminfo - always use patterns
14691480
safe_patterns.append(r'\x1b\[\?2004[hl]') # bracketed paste mode
14701481
safe_patterns.append(r'\x1b\[\?12[hl]') # cursor blinking (may be separate)

0 commit comments

Comments
 (0)