changeset 36056:1c322658f43e

py3: replace file() with open() in test-subrepo-missing.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/D2117
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 11 Feb 2018 17:02:14 +0530
parents eed40f0f4c6f
children 2ea0e89bca1e
files tests/test-subrepo-missing.t
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-subrepo-missing.t	Sun Feb 11 17:01:25 2018 +0530
+++ b/tests/test-subrepo-missing.t	Sun Feb 11 17:02:14 2018 +0530
@@ -14,7 +14,7 @@
 
 ignore blanklines in .hgsubstate
 
-  >>> file('.hgsubstate', 'wb').write('\n\n   \t \n   \n')
+  >>> open('.hgsubstate', 'wb').write(b'\n\n   \t \n   \n')
   $ hg st --subrepos
   M .hgsubstate
   $ hg revert -qC .hgsubstate
@@ -22,7 +22,7 @@
 abort more gracefully on .hgsubstate parsing error
 
   $ cp .hgsubstate .hgsubstate.old
-  >>> file('.hgsubstate', 'wb').write('\ninvalid')
+  >>> open('.hgsubstate', 'wb').write(b'\ninvalid')
   $ hg st --subrepos --cwd $TESTTMP -R $TESTTMP/repo
   abort: invalid subrepository revision specifier in 'repo/.hgsubstate' line 2
   [255]