Patchwork D2122: py3: replace file() with open() in test-mactext.t

login
register
mail settings
Submitter phabricator
Date Feb. 11, 2018, 2:04 p.m.
Message ID <19369b237e3287ebd3ae3e069cc77ae7@localhost.localdomain>
Download mbox | patch
Permalink /patch/27563/
State Not Applicable
Headers show

Comments

phabricator - Feb. 11, 2018, 2:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGadec6374a0b2: py3: replace file() with open() in test-mactext.t (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2122?vs=5385&id=5411

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

AFFECTED FILES
  tests/test-mactext.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-mactext.t b/tests/test-mactext.t
--- a/tests/test-mactext.t
+++ b/tests/test-mactext.t
@@ -3,9 +3,9 @@ 
   > import sys
   > 
   > for path in sys.argv[1:]:
-  >     data = file(path, 'rb').read()
-  >     data = data.replace('\n', '\r')
-  >     file(path, 'wb').write(data)
+  >     data = open(path, 'rb').read()
+  >     data = data.replace(b'\n', b'\r')
+  >     open(path, 'wb').write(data)
   > EOF
   $ cat > print.py <<EOF
   > import sys