D2132: py3: replace file() with open() in test-convert-hg-source.t
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Sun Feb 11 12:42:46 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.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D2132
AFFECTED FILES
tests/test-convert-hg-source.t
CHANGE DETAILS
diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t
--- a/tests/test-convert-hg-source.t
+++ b/tests/test-convert-hg-source.t
@@ -127,8 +127,8 @@
> import sys
> # Interlace LF and CRLF
> lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n'))
- > for i, l in enumerate(file(sys.argv[1]))]
- > file(sys.argv[1], 'wb').write(''.join(lines))
+ > for i, l in enumerate(open(sys.argv[1]))]
+ > open(sys.argv[1], 'wb').write(''.join(lines))
> EOF
$ $PYTHON rewrite.py new/.hg/shamap
$ cd orig
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list