diff tests/test-mq-eol.t @ 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 5abc47d4ca6b
children 7295279b9ea5
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