Patchwork py3: fix test-diff-newlines.t to be compatible with py3

login
register
mail settings
Submitter Boris Feld
Date July 6, 2017, 4:04 p.m.
Message ID <a6392dbb41f976436b0c.1499357052@FB>
Download mbox | patch
Permalink /patch/22024/
State Accepted
Headers show

Comments

Boris Feld - July 6, 2017, 4:04 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1499354330 -7200
#      Thu Jul 06 17:18:50 2017 +0200
# Node ID a6392dbb41f976436b0c7e499242f96c9cb3edf1
# Parent  89796a25d4bb91fb418ad3e70faad2c586902ffb
# EXP-Topic py3
py3: fix test-diff-newlines.t to be compatible with py3
Sean Farley - July 6, 2017, 6:08 p.m.
Boris Feld <boris.feld@octobus.net> writes:

> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1499354330 -7200
> #      Thu Jul 06 17:18:50 2017 +0200
> # Node ID a6392dbb41f976436b0c7e499242f96c9cb3edf1
> # Parent  89796a25d4bb91fb418ad3e70faad2c586902ffb
> # EXP-Topic py3
> py3: fix test-diff-newlines.t to be compatible with py3

Sure, seems fine. Queued!

Patch

diff -r 89796a25d4bb -r a6392dbb41f9 contrib/python3-whitelist
--- a/contrib/python3-whitelist	Mon Jul 03 11:22:00 2017 +0200
+++ b/contrib/python3-whitelist	Thu Jul 06 17:18:50 2017 +0200
@@ -11,6 +11,7 @@ 
 test-contrib-check-commit.t
 test-ctxmanager.py
 test-diff-issue2761.t
+test-diff-newlines.t
 test-diff-reverse.t
 test-diff-subdir.t
 test-dirstate-nonnormalset.t
diff -r 89796a25d4bb -r a6392dbb41f9 tests/test-diff-newlines.t
--- a/tests/test-diff-newlines.t	Mon Jul 03 11:22:00 2017 +0200
+++ b/tests/test-diff-newlines.t	Thu Jul 06 17:18:50 2017 +0200
@@ -1,6 +1,6 @@ 
   $ hg init
 
-  $ $PYTHON -c 'file("a", "wb").write("confuse str.splitlines\nembedded\rnewline\n")'
+  $ $PYTHON -c 'open("a", "wb").write(b"confuse str.splitlines\nembedded\rnewline\n")'
   $ hg ci -Ama -d '1 0'
   adding a