Patchwork D2119: py3: replace file() with open() in test-patch-offset.t

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

Comments

phabricator - Feb. 11, 2018, 12:40 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/D2119

AFFECTED FILES
  tests/test-patch-offset.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-patch-offset.t b/tests/test-patch-offset.t
--- a/tests/test-patch-offset.t
+++ b/tests/test-patch-offset.t
@@ -5,7 +5,7 @@ 
   > path = sys.argv[1]
   > patterns = sys.argv[2:]
   > 
-  > fp = file(path, 'wb')
+  > fp = open(path, 'wb')
   > for pattern in patterns:
   >     count = int(pattern[0:-1])
   >     char = pattern[-1] + '\n'