Patchwork D2124: py3: replace file() with open() in test-import-git.t

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

Comments

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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2124?vs=5387&id=5413

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

AFFECTED FILES
  tests/test-import-git.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-import-git.t b/tests/test-import-git.t
--- a/tests/test-import-git.t
+++ b/tests/test-import-git.t
@@ -563,10 +563,10 @@ 
   > Mc$`b*O5$Pw00T?_*Z=?k
   > 
   > EOF
-  >>> fp = file('binary.diff', 'rb')
+  >>> fp = open('binary.diff', 'rb')
   >>> data = fp.read()
   >>> fp.close()
-  >>> file('binary.diff', 'wb').write(data.replace('\n', '\r\n'))
+  >>> open('binary.diff', 'wb').write(data.replace(b'\n', b'\r\n'))
   $ rm binary2
   $ hg import --no-commit binary.diff
   applying binary.diff