Skip to content

Commit

Permalink
fsed/utils.py: fix read/write '-' in py2
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Roberts committed Dec 19, 2015
1 parent 4aaf374 commit 2ed13e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fsed/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def open_file(filename, mode='rb'):
if filename == '-' and 'r' in mode:
if PY3:
return sys.stdin.buffer
return sys.stdin
elif filename == '-' and ('w' in mode or 'a' in mode):
if PY3:
return sys.stdout.buffer
return sys.stdout
if filename.lower().count('.zip:'):
assert 'r' in mode
assert filename.count(':') == 1
Expand Down

0 comments on commit 2ed13e5

Please sign in to comment.