Mercurial > hg
diff tests/test-import-context.t @ 36394:4bc983568016
py3: replace file() with open()
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D2417
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 24 Feb 2018 16:07:45 +0530 |
parents | 75be14993fda |
children | bf953d218a91 |
line wrap: on
line diff
--- a/tests/test-import-context.t Sat Feb 24 16:06:21 2018 +0530 +++ b/tests/test-import-context.t Sat Feb 24 16:07:45 2018 +0530 @@ -7,7 +7,7 @@ > lasteol = sys.argv[2] == '1' > patterns = sys.argv[3:] > - > fp = file(path, 'wb') + > fp = open(path, 'wb') > for i, pattern in enumerate(patterns): > count = int(pattern[0:-1]) > char = pattern[-1] + '\n' @@ -19,7 +19,7 @@ > EOF $ cat > cat.py <<EOF > import sys - > sys.stdout.write(repr(file(sys.argv[1], 'rb').read()) + '\n') + > sys.stdout.write(repr(open(sys.argv[1], 'rb').read()) + '\n') > EOF Initialize the test repository