Mercurial > hg
comparison tests/test-extdiff.t @ 36029:d83fc41dabf3
py3: replace file() with open() in test-extdiff.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/D2128
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 17:13:11 +0530 |
parents | 3b77d4787c18 |
children | be5a6fe3643a |
comparison
equal
deleted
inserted
replaced
36028:f6a8a81f4f7b | 36029:d83fc41dabf3 |
---|---|
250 | 250 |
251 $ cat > 'diff tool.py' << EOT | 251 $ cat > 'diff tool.py' << EOT |
252 > #!$PYTHON | 252 > #!$PYTHON |
253 > import time | 253 > import time |
254 > time.sleep(1) # avoid unchanged-timestamp problems | 254 > time.sleep(1) # avoid unchanged-timestamp problems |
255 > file('a/a', 'ab').write('edited\n') | 255 > open('a/a', 'ab').write(b'edited\n') |
256 > file('a/b', 'ab').write('edited\n') | 256 > open('a/b', 'ab').write(b'edited\n') |
257 > EOT | 257 > EOT |
258 | 258 |
259 #if execbit | 259 #if execbit |
260 $ chmod +x 'diff tool.py' | 260 $ chmod +x 'diff tool.py' |
261 #endif | 261 #endif |