py3: replace file() with open() in test-extdiff.t
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 11 Feb 2018 17:13:11 +0530
changeset 36067 d83fc41dabf3
parent 36066 f6a8a81f4f7b
child 36068 b85b0bbed6de
py3: replace file() with open() in test-extdiff.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/D2128
tests/test-extdiff.t
--- a/tests/test-extdiff.t	Sun Feb 11 17:12:28 2018 +0530
+++ b/tests/test-extdiff.t	Sun Feb 11 17:13:11 2018 +0530
@@ -252,8 +252,8 @@
   > #!$PYTHON
   > import time
   > time.sleep(1) # avoid unchanged-timestamp problems
-  > file('a/a', 'ab').write('edited\n')
-  > file('a/b', 'ab').write('edited\n')
+  > open('a/a', 'ab').write(b'edited\n')
+  > open('a/b', 'ab').write(b'edited\n')
   > EOT
 
 #if execbit