Skip to content
Permalink
Browse files

tools: make pty_helper.py python3-compatible

Fixes: #29166

PR-URL: #29167
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information...
bnoordhuis authored and targos committed Aug 16, 2019
1 parent 5c5ef4e commit acdc21b8329dd67af0152877f2f9c0769deb15f5
Showing with 5 additions and 1 deletion.
  1. +5 −1 test/pseudo-tty/pty_helper.py
@@ -25,8 +25,12 @@ def pipe(sfd, dfd):
if dfd == STDOUT:
# Work around platform quirks. Some platforms echo ^D as \x04
# (AIX, BSDs) and some don't (Linux).
filt = lambda c: ord(c) > 31 or c in '\t\n\r\f'
#
# The comparison against b' '[0] is because |data| is
# a string in python2 but a bytes object in python3.
filt = lambda c: c >= b' '[0] or c in b'\t\n\r\f'
data = filter(filt, data)
data = bytes(data)

while data:
try:

0 comments on commit acdc21b

Please sign in to comment.
You can’t perform that action at this time.