From patchwork Sun Feb 11 14:05:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2129: py3: replace file() with open() in test-eol.t From: phabricator X-Patchwork-Id: 27570 Message-Id: <1d4f009e7f45a3064968792ce1fcee05@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Sun, 11 Feb 2018 14:05:30 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGb85b0bbed6de: py3: replace file() with open() in test-eol.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2129?vs=5392&id=5418 REVISION DETAIL https://phab.mercurial-scm.org/D2129 AFFECTED FILES tests/test-eol.t CHANGE DETAILS To: pulkit, #hg-reviewers Cc: mercurial-devel diff --git a/tests/test-eol.t b/tests/test-eol.t --- a/tests/test-eol.t +++ b/tests/test-eol.t @@ -17,12 +17,12 @@ > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > except ImportError: > pass - > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n') + > (old, new) = sys.argv[1] == 'LF' and (b'\n', b'\r\n') or (b'\r\n', b'\n') > print("%% switching encoding from %r to %r" % (old, new)) > for path in sys.argv[2:]: - > data = file(path, 'rb').read() + > data = open(path, 'rb').read() > data = data.replace(old, new) - > file(path, 'wb').write(data) + > open(path, 'wb').write(data) > EOF $ seteol () {