From patchwork Mon Feb 12 08:48:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2132: py3: replace file() with open() in test-convert-hg-source.t From: phabricator X-Patchwork-Id: 27655 Message-Id: <9f418f4f81f89895ebd6478c6488350c@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Mon, 12 Feb 2018 08:48:27 +0000 pulkit updated this revision to Diff 5481. pulkit edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2132?vs=5395&id=5481 REVISION DETAIL https://phab.mercurial-scm.org/D2132 AFFECTED FILES tests/test-convert-hg-source.t CHANGE DETAILS To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t --- a/tests/test-convert-hg-source.t +++ b/tests/test-convert-hg-source.t @@ -126,9 +126,9 @@ $ cat > rewrite.py < import sys > # Interlace LF and CRLF - > lines = [(l.rstrip() + ((i % 2) and '\n' or '\r\n')) - > for i, l in enumerate(file(sys.argv[1]))] - > file(sys.argv[1], 'wb').write(''.join(lines)) + > lines = [(l.rstrip() + ((i % 2) and b'\n' or b'\r\n')) + > for i, l in enumerate(open(sys.argv[1], 'rb'))] + > open(sys.argv[1], 'wb').write(b''.join(lines)) > EOF $ $PYTHON rewrite.py new/.hg/shamap $ cd orig