Don't write to streams when pythonw makes them None.

This commit is contained in:
voussoir 2021-09-23 22:37:55 -07:00
parent 5a2eca486f
commit 3c82dc64e0
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -182,11 +182,14 @@ def _output(stream, line, end):
stream.flush()
def stdout(line='', end='\n'):
_output(sys.stdout, line, end)
# In pythonw, stdout is None.
if sys.stdout is not None:
_output(sys.stdout, line, end)
def stderr(line='', end='\n'):
_output(sys.stderr, line, end)
# In pythonw, stderr is None.
if sys.stderr is not None:
_output(sys.stderr, line, end)
def go(args=None, *input_args, **input_kwargs):
'''