Don't write to streams when pythonw makes them None.
This commit is contained in:
parent
5a2eca486f
commit
3c82dc64e0
1 changed files with 6 additions and 3 deletions
|
@ -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):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue