Skip to content
Myr

Do not write to the console if it's not a tty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent de79af1 · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:click/_winconsole.py+2 added-1 removed
240 unmodified lines
241242243def _get_windows_console_stream(f, encoding, errors):244 if encoding in ('utf-16-le', None) \245 and errors in ('strict', None):245 and errors in ('strict', None) and \246 hasattr(f, 'isatty') and f.isatty():247 func = _stream_factories.get(f.fileno())248 if func is not None:249 return func()