Skip to content

Commit

Permalink
Protect tests/writetofile.py from test discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Aug 21, 2012
1 parent 57462a9 commit 61e38b8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions IPython/frontend/terminal/console/tests/writetofile.py
Expand Up @@ -17,16 +17,17 @@
"""

import sys
from IPython.utils.py3compat import PY3
(inpath, outpath) = sys.argv[1:]

if inpath == '-':
if PY3:
infile = sys.stdin.buffer
if __name__ == '__main__':
import sys
from IPython.utils.py3compat import PY3
(inpath, outpath) = sys.argv[1:]

if inpath == '-':
if PY3:
infile = sys.stdin.buffer
else:
infile = sys.stdin
else:
infile = sys.stdin
else:
infile = open(inpath, 'rb')
infile = open(inpath, 'rb')

open(outpath, 'w+b').write(infile.read())
open(outpath, 'w+b').write(infile.read())

0 comments on commit 61e38b8

Please sign in to comment.