X Tutup
Skip to content

Commit a5ab00f

Browse files
committed
make string clean-up routines use the clearer \0, \r and \n literals as opposed to hex codes
1 parent e37a380 commit a5ab00f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bpython/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,11 @@ def echo(self, s, redraw=True):
467467
a = a | curses.A_BOLD
468468
s = s.replace('\x03', '')
469469
s = s.replace('\x01', '')
470+
470471
# Replace NUL bytes, as addstr raises an exception otherwise
471-
s = s.replace('\x00', '')
472+
s = s.replace('\0', '')
472473
# Replace \r\n bytes, as addstr remove the current line otherwise
473-
s = s.replace('\x0D\x0A', '\x0A')
474+
s = s.replace('\r\n', '\n')
474475

475476
self.scr.addstr(s, a)
476477

0 commit comments

Comments
 (0)
X Tutup