Show More
@@ -17,16 +17,17 If INPUT is '-', stdin is used. | |||||
17 |
|
17 | |||
18 | """ |
|
18 | """ | |
19 |
|
19 | |||
20 | import sys |
|
20 | if __name__ == '__main__': | |
21 | from IPython.utils.py3compat import PY3 |
|
21 | import sys | |
22 | (inpath, outpath) = sys.argv[1:] |
|
22 | from IPython.utils.py3compat import PY3 | |
23 |
|
23 | (inpath, outpath) = sys.argv[1:] | ||
24 | if inpath == '-': |
|
24 | ||
25 | if PY3: |
|
25 | if inpath == '-': | |
26 | infile = sys.stdin.buffer |
|
26 | if PY3: | |
|
27 | infile = sys.stdin.buffer | |||
|
28 | else: | |||
|
29 | infile = sys.stdin | |||
27 | else: |
|
30 | else: | |
28 |
infile = |
|
31 | infile = open(inpath, 'rb') | |
29 | else: |
|
|||
30 | infile = open(inpath, 'rb') |
|
|||
31 |
|
32 | |||
32 | open(outpath, 'w+b').write(infile.read()) |
|
33 | open(outpath, 'w+b').write(infile.read()) |
General Comments 0
You need to be logged in to leave comments.
Login now