Mercurial > public > mercurial-scm > hg
diff tests/test-mactext.t @ 36023:adec6374a0b2
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 17:07:09 +0530 |
parents | 75be14993fda |
children | 5abc47d4ca6b |
line wrap: on
line diff
--- 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