# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1514505957 -19800 # Node ID 15ddf83fbf84cec2fa21ba3e48b98f8ba0d9e3aa # Parent 86f9aabed67b7d9de658d8fe7a14c98cb2cbbfb8 py3: use bytes and open() instead of file() in test-diff-upgrade.t file() is not present in Python 3. Differential Revision: https://phab.mercurial-scm.org/D1789 diff -r 86f9aabed67b -r 15ddf83fbf84 tests/test-diff-upgrade.t --- a/tests/test-diff-upgrade.t Wed Jan 10 11:02:20 2018 -0800 +++ b/tests/test-diff-upgrade.t Fri Dec 29 05:35:57 2017 +0530 @@ -16,7 +16,7 @@ $ echo regular > regular $ echo rmregular > rmregular - $ $PYTHON -c "file('bintoregular', 'wb').write('\0')" + $ $PYTHON -c "open('bintoregular', 'wb').write(b'\0')" $ touch rmempty $ echo exec > exec $ chmod +x exec @@ -26,7 +26,7 @@ $ echo unsetexec > unsetexec $ chmod +x unsetexec $ echo binary > binary - $ $PYTHON -c "file('rmbinary', 'wb').write('\0')" + $ $PYTHON -c "open('rmbinary', 'wb').write(b'\0')" $ hg ci -Am addfiles adding binary adding bintoregular @@ -50,8 +50,8 @@ $ rm rmexec $ chmod +x setexec $ chmod -x unsetexec - $ $PYTHON -c "file('binary', 'wb').write('\0\0')" - $ $PYTHON -c "file('newbinary', 'wb').write('\0')" + $ $PYTHON -c "open('binary', 'wb').write(b'\0\0')" + $ $PYTHON -c "open('newbinary', 'wb').write(b'\0')" $ rm rmbinary $ hg addremove -s 0 adding newbinary