# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-11 11:37:09 # Node ID adec6374a0b2ab10fbaf6df63b5170b08c29886c # Parent b911995040f93246c04e6edd6b3bd0a10275e629 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 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 < import sys