Patchwork D2134: py3: replace file() with open() in test-contrib.t

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

Comments

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

AFFECTED FILES
  tests/test-contrib.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-contrib.t b/tests/test-contrib.t
--- a/tests/test-contrib.t
+++ b/tests/test-contrib.t
@@ -201,7 +201,7 @@ 
 
 binary file
 
-  $ $PYTHON -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
+  $ $PYTHON -c "f = open('binary-local', 'w'); f.write('\x00'); f.close()"
   $ cat orig >> binary-local
   $ $PYTHON simplemerge -p binary-local base other
   warning: binary-local looks like a binary file.