changeset 41329:84707d9e77a0

tests: write directly to stdout to avoid b'' prefixes This enables the test to pass on Python 3. Differential Revision: https://phab.mercurial-scm.org/D5668
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 23 Jan 2019 17:45:11 -0800
parents 13ccb03f2145
children d5c58d679ed9
files tests/test-mq-eol.t
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-mq-eol.t	Wed Jan 23 17:41:46 2019 -0800
+++ b/tests/test-mq-eol.t	Wed Jan 23 17:45:11 2019 -0800
@@ -30,10 +30,14 @@
 
   $ cat > cateol.py <<EOF
   > import sys
+  > try:
+  >     stdout = sys.stdout.buffer
+  > except AttributeError:
+  >     stdout = sys.stdout
   > for line in open(sys.argv[1], 'rb'):
   >     line = line.replace(b'\r', b'<CR>')
   >     line = line.replace(b'\n', b'<LF>')
-  >     print(line)
+  >     stdout.write(line + b'\n')
   > EOF
 
   $ hg init repo