##// END OF EJS Templates
Python 3 compatibility fix on tests/writetofile.py
Takafumi Arakaki -
Show More
@@ -10,11 +10,15 b' Copy data from input file to output file for testing.'
10 """
10 """
11
11
12 import sys
12 import sys
13 from IPython.utils.py3compat import PY3
13 (inpath, outpath) = sys.argv[1:]
14 (inpath, outpath) = sys.argv[1:]
14
15
15 if inpath == '-':
16 if inpath == '-':
16 infile = sys.stdin
17 if PY3:
18 infile = sys.stdin.buffer
19 else:
20 infile = sys.stdin
17 else:
21 else:
18 infile = open(inpath)
22 infile = open(inpath, 'rb')
19
23
20 open(outpath, 'w+b').write(infile.read())
24 open(outpath, 'w+b').write(infile.read())
General Comments 0
You need to be logged in to leave comments. Login now