D2112: py3: replace file() with open() in test-convert-p4-filetypes.t

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sun Feb 11 12:39:31 UTC 2018


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. While I was here, I added b'' prefix to make
  sure we write things correctly in Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-convert-p4-filetypes.t

CHANGE DETAILS

diff --git a/tests/test-convert-p4-filetypes.t b/tests/test-convert-p4-filetypes.t
--- a/tests/test-convert-p4-filetypes.t
+++ b/tests/test-convert-p4-filetypes.t
@@ -52,7 +52,7 @@
   >          p4 add -t $T file_$T2
   >          ;;
   >       binary*)
-  >          $PYTHON -c "file('file_$T2', 'wb').write('this is $T')"
+  >          $PYTHON -c "open('file_$T2', 'wb').write(b'this is $T')"
   >          p4 add -t $T file_$T2
   >          ;;
   >       *)



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


More information about the Mercurial-devel mailing list