changeset 36019:2ea0e89bca1e

py3: replace file() with open() in test-relink.t file() is not present in Python 3. This patch also adds a b'' prefix to make sure we write bytes in Python 3. Differential Revision: https://phab.mercurial-scm.org/D2118
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 11 Feb 2018 17:03:17 +0530
parents 1c322658f43e
children bfc9ab6c1bec
files tests/test-relink.t
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-relink.t	Sun Feb 11 17:02:14 2018 +0530
+++ b/tests/test-relink.t	Sun Feb 11 17:03:17 2018 +0530
@@ -49,7 +49,7 @@
 
 Test files are read in binary mode
 
-  $ $PYTHON -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
+  $ $PYTHON -c "open('.hg/store/data/dummy.i', 'wb').write(b'a\r\nb\n')"
   $ cd ..
 
 
@@ -68,7 +68,7 @@
   $ echo b >> b
   $ hg ci -m changeb
   created new head
-  $ $PYTHON -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
+  $ $PYTHON -c "open('.hg/store/data/dummy.i', 'wb').write(b'a\nb\r\n')"
 
 
 relink