D2128: py3: replace file() with open() in test-extdiff.t
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Sun Feb 11 12:42:08 UTC 2018
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2128
AFFECTED FILES
tests/test-extdiff.t
CHANGE DETAILS
diff --git a/tests/test-extdiff.t b/tests/test-extdiff.t
--- a/tests/test-extdiff.t
+++ b/tests/test-extdiff.t
@@ -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
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list