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.
  This patch also adds a b'' prefix to make sure we write bytes in Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-mactext.t

CHANGE DETAILS

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



To: pulkit, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to