Skip to content

Commit

Permalink
Fix reading from stdin in Python 3.x
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
dbohdan committed Sep 2, 2016
1 parent 7ec0f9a commit 37cd5b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions remarshal.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import yaml

FORMATS = ['json', 'toml', 'yaml']
__version__ = '0.5.0'
__version__ = '0.5.1'

def filename2format(filename):
try:
Expand Down Expand Up @@ -104,7 +104,7 @@ def run(argv):
def remarshal(input, output, input_format, output_format, wrap=None,
unwrap=None, indent_json=None, yaml_options={}):
if input == '-':
input_file = sys.stdin
input_file = getattr(sys.stdin, 'buffer', sys.stdin)
else:
input_file = open(input, 'rb')

Expand Down

0 comments on commit 37cd5b1

Please sign in to comment.