Skip to content

Commit

Permalink
'x' and 'a' filemodes use stdout when file is '-' (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonio21 authored and mitsuhiko committed Mar 31, 2018
1 parent 60ef759 commit b8f5744
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion click/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def open_stream(filename, mode='r', encoding=None, errors='strict',
# Standard streams first. These are simple because they don't need
# special handling for the atomic flag. It's entirely ignored.
if filename == '-':
if 'w' in mode:
if any(m in mode for m in ['w', 'a', 'x']):
if 'b' in mode:
return get_binary_stdout(), False
return get_text_stdout(encoding=encoding, errors=errors), False
Expand Down

0 comments on commit b8f5744

Please sign in to comment.