Patchwork D2132: py3: replace file() with open() in test-convert-hg-source.t

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2018, 12:42 p.m.
Message ID <differential-rev-PHID-DREV-acnrhy4lfrblooonl7kz-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27547/
State Superseded
Headers show

Comments

phabricator - Feb. 11, 2018, 12:42 p.m.
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




To: pulkit, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 11, 2018, 2:08 p.m.
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  Needs b''.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2132

To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

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