Compare commits

...

2 commits

2 changed files with 4 additions and 0 deletions

View file

@ -9,6 +9,8 @@ This is a collection of tools that I use often and import into my other projects
## Mirrors
https://git.voussoir.net/voussoir/voussoirkit
https://github.com/voussoir/voussoirkit
https://gitlab.com/voussoir/voussoirkit

View file

@ -178,11 +178,13 @@ def output(stream, line, *, end):
stream.flush()
def stdout(line='', end='\n'):
line = line.replace('\r\n', '\n')
# In pythonw, stdout is None.
if sys.stdout is not None:
output(sys.stdout, line, end=end)
def stderr(line='', end='\n'):
line = line.replace('\r\n', '\n')
# In pythonw, stderr is None.
if sys.stderr is not None:
output(sys.stderr, line, end=end)