# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-11 11:29:35 # Node ID 3790d735ff68c75ae0fc58f771c7a4ea58c33254 # Parent d7238d125aa2dd2b305bcb82d7075fc938642015 py3: replace file() with open() in test-walk.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/D2114 diff --git a/tests/test-walk.t b/tests/test-walk.t --- a/tests/test-walk.t +++ b/tests/test-walk.t @@ -494,12 +494,12 @@ Test patterns: Test listfile and listfile0 - $ $PYTHON -c "file('listfile0', 'wb').write('fenugreek\0new\0')" + $ $PYTHON -c "open('listfile0', 'wb').write(b'fenugreek\0new\0')" $ hg debugwalk -I 'listfile0:listfile0' matcher: f fenugreek fenugreek f new new - $ $PYTHON -c "file('listfile', 'wb').write('fenugreek\nnew\r\nmammals/skunk\n')" + $ $PYTHON -c "open('listfile', 'wb').write(b'fenugreek\nnew\r\nmammals/skunk\n')" $ hg debugwalk -I 'listfile:listfile' matcher: f fenugreek fenugreek