Mercurial > hg-stable
changeset 36063:32695e525586
py3: replace file() with open() in test-import-git.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/D2124
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 17:09:37 +0530 |
parents | 2a81ed6c3bb9 |
children | a4d7e51709e5 |
files | tests/test-import-git.t |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-import-git.t Sun Feb 11 17:08:40 2018 +0530 +++ b/tests/test-import-git.t Sun Feb 11 17:09:37 2018 +0530 @@ -563,10 +563,10 @@ > Mc$`b*O5$Pw00T?_*Z=?k > > EOF - >>> fp = file('binary.diff', 'rb') + >>> fp = open('binary.diff', 'rb') >>> data = fp.read() >>> fp.close() - >>> file('binary.diff', 'wb').write(data.replace('\n', '\r\n')) + >>> open('binary.diff', 'wb').write(data.replace(b'\n', b'\r\n')) $ rm binary2 $ hg import --no-commit binary.diff applying binary.diff