Patchwork D1789: py3: use bytes and open() instead of file() in test-diff-upgrade.t

login
register
mail settings
Submitter phabricator
Date Jan. 10, 2018, 11:03 p.m.
Message ID <5be236b5e8595c357c3981cea6c48c67@localhost.localdomain>
Download mbox | patch
Permalink /patch/26656/
State Not Applicable
Headers show

Comments

phabricator - Jan. 10, 2018, 11:03 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG15ddf83fbf84: py3: use bytes and open() instead of file() in test-diff-upgrade.t (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1789?vs=4666&id=4772

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

AFFECTED FILES
  tests/test-diff-upgrade.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-diff-upgrade.t b/tests/test-diff-upgrade.t
--- a/tests/test-diff-upgrade.t
+++ b/tests/test-diff-upgrade.t
@@ -16,7 +16,7 @@ 
 
   $ echo regular > regular
   $ echo rmregular > rmregular
-  $ $PYTHON -c "file('bintoregular', 'wb').write('\0')"
+  $ $PYTHON -c "open('bintoregular', 'wb').write(b'\0')"
   $ touch rmempty
   $ echo exec > exec
   $ chmod +x exec
@@ -26,7 +26,7 @@ 
   $ echo unsetexec > unsetexec
   $ chmod +x unsetexec
   $ echo binary > binary
-  $ $PYTHON -c "file('rmbinary', 'wb').write('\0')"
+  $ $PYTHON -c "open('rmbinary', 'wb').write(b'\0')"
   $ hg ci -Am addfiles
   adding binary
   adding bintoregular
@@ -50,8 +50,8 @@ 
   $ rm rmexec
   $ chmod +x setexec
   $ chmod -x unsetexec
-  $ $PYTHON -c "file('binary', 'wb').write('\0\0')"
-  $ $PYTHON -c "file('newbinary', 'wb').write('\0')"
+  $ $PYTHON -c "open('binary', 'wb').write(b'\0\0')"
+  $ $PYTHON -c "open('newbinary', 'wb').write(b'\0')"
   $ rm rmbinary
   $ hg addremove -s 0
   adding newbinary