# HG changeset patch # User Augie Fackler # Date 1559138375 14400 # Node ID 37f38e1dea4429f01a0c9343a490ad9d64cd5eea # Parent 055687fe4c47252f1e7d1ca4a1bde921072202bd testparseutil: stop extracting using std* streams as bytes on py3 This is no longer required due to other cleanups in our linting tools. Differential Revision: https://phab.mercurial-scm.org/D6455 diff -r 055687fe4c47 -r 37f38e1dea44 contrib/testparseutil.py --- a/contrib/testparseutil.py Wed May 29 09:56:27 2019 -0400 +++ b/contrib/testparseutil.py Wed May 29 09:59:35 2019 -0400 @@ -38,12 +38,6 @@ if ispy3: import builtins - # TODO: .buffer might not exist if std streams were replaced; we'll need - # a silly wrapper to make a bytes stream backed by a unicode one. - stdin = sys.stdin.buffer - stdout = sys.stdout.buffer - stderr = sys.stderr.buffer - def bytestr(s): # tiny version of pycompat.bytestr return s.encode('latin1') @@ -56,10 +50,6 @@ def opentext(f): return open(f, 'r') else: - stdin = sys.stdin - stdout = sys.stdout - stderr = sys.stderr - bytestr = str sysstr = identity @@ -71,11 +61,11 @@ def writeout(data): # write "data" in BYTES into stdout - stdout.write(data) + sys.stdout.write(data) def writeerr(data): # write "data" in BYTES into stderr - stderr.write(data) + sys.stderr.write(data) #################### @@ -583,7 +573,7 @@ if showembedded(f, fp, embeddedfunc, opts): ret = 1 else: - lines = [l for l in stdin.readlines()] + lines = [l for l in sys.stdin.readlines()] if showembedded('', lines, embeddedfunc, opts): ret = 1 return ret