py3: replace file() with open() in test-mactext.t
file() is not present in Python 3.
This patch also adds a b'' prefix to make sure we write bytes in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2122
--- a/tests/test-mactext.t Sun Feb 11 17:06:04 2018 +0530
+++ b/tests/test-mactext.t Sun Feb 11 17:07:09 2018 +0530
@@ -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