changeset 36028:f6a8a81f4f7b

py3: replace file() with open() in test-fileset.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/D2127
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 11 Feb 2018 17:12:28 +0530
parents d667302b6ee1
children d83fc41dabf3
files tests/test-fileset.t
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-fileset.t	Sun Feb 11 17:11:45 2018 +0530
+++ b/tests/test-fileset.t	Sun Feb 11 17:12:28 2018 +0530
@@ -180,7 +180,7 @@
 
 Test files properties
 
-  >>> file('bin', 'wb').write('\0a')
+  >>> open('bin', 'wb').write(b'\0a')
   $ fileset 'binary()'
   $ fileset 'binary() and unknown()'
   bin
@@ -219,8 +219,8 @@
   $ hg --config ui.portablefilenames=ignore add con.xml
 #endif
 
-  >>> file('1k', 'wb').write(' '*1024)
-  >>> file('2k', 'wb').write(' '*2048)
+  >>> open('1k', 'wb').write(b' '*1024)
+  >>> open('2k', 'wb').write(b' '*2048)
   $ hg add 1k 2k
   $ fileset 'size("bar")'
   hg: parse error: couldn't parse size: bar