Patchwork D5668: tests: write directly to stdout to avoid b'' prefixes

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2019, 2:26 a.m.
Message ID <cf904e0cedcb19073c60716419c946dd@localhost.localdomain>
Download mbox | patch
Permalink /patch/37948/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2019, 2:26 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG84707d9e77a0: tests: write directly to stdout to avoid b&#039;&#039; prefixes (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5668?vs=13380&id=13386

REVISION DETAIL
  https://phab.mercurial-scm.org/D5668

AFFECTED FILES
  tests/test-mq-eol.t

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
--- a/tests/test-mq-eol.t
+++ b/tests/test-mq-eol.t
@@ -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