Skip to content

Commit 4d8abae

Browse files
miss-islingtonchris-eiblambv
authored
[3.13] gh-143394: filter for turning off automatic margins in test_no_newline (GH-143433) (GH-143478)
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent 97694de commit 4d8abae

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 = curses.tigetstr("rmam")
1470+
smam = curses.tigetstr("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)