# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-11 11:41:45 # Node ID d667302b6ee1b37b2940db9282a2aed00f0636f4 # Parent a4d7e51709e5d9991944781f9c9925bb8995d7b8 py3: replace file() with open() in test-import-bypass.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/D2126 diff --git a/tests/test-import-bypass.t b/tests/test-import-bypass.t --- a/tests/test-import-bypass.t +++ b/tests/test-import-bypass.t @@ -227,7 +227,7 @@ Test patch.eol is handled (this also tests that editor is not invoked for '--bypass', if the commit message is explicitly specified, regardless of '--edit') - $ $PYTHON -c 'file("a", "wb").write("a\r\n")' + $ $PYTHON -c 'open("a", "wb").write(b"a\r\n")' $ hg ci -m makeacrlf $ HGEDITOR=cat hg import -m 'should fail because of eol' --edit --bypass ../test.diff applying ../test.diff