Patchwork D2133: py3: replace file() with open() in test-convert-git.t

login
register
mail settings
Submitter phabricator
Date Feb. 17, 2018, 12:43 p.m.
Message ID <931fc45d5d1fe80a60b7607039ce531a@localhost.localdomain>
Download mbox | patch
Permalink /patch/28027/
State Not Applicable
Headers show

Comments

phabricator - Feb. 17, 2018, 12:43 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG868bb2821e29: py3: replace file() with open() in test-convert-git.t (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2133?vs=5808&id=5810

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

AFFECTED FILES
  tests/test-convert-git.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
--- a/tests/test-convert-git.t
+++ b/tests/test-convert-git.t
@@ -420,7 +420,7 @@ 
   $ mkdir git-repo3
   $ cd git-repo3
   $ git init-db >/dev/null 2>/dev/null
-  $ $PYTHON -c 'file("b", "wb").write("".join([chr(i) for i in range(256)])*16)'
+  $ $PYTHON -c 'import struct; open("b", "wb").write(b"".join([struct.Struct(">B").pack(i) for i in range(256)])*16)'
   $ git add b
   $ commit -a -m addbinary
   $ cd ..
@@ -437,7 +437,7 @@ 
   $ cd git-repo3-hg
   $ hg up -C
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ $PYTHON -c 'print len(file("b", "rb").read())'
+  $ $PYTHON -c 'print len(open("b", "rb").read())'
   4096
   $ cd ..