Replace CRLF with LF in stdout, stderr, because stdin reads double LF.
This commit is contained in:
parent
ac53cd71aa
commit
16d0c0dee3
1 changed files with 2 additions and 0 deletions
|
@ -178,11 +178,13 @@ def output(stream, line, *, end):
|
||||||
stream.flush()
|
stream.flush()
|
||||||
|
|
||||||
def stdout(line='', end='\n'):
|
def stdout(line='', end='\n'):
|
||||||
|
line = line.replace('\r\n', '\n')
|
||||||
# In pythonw, stdout is None.
|
# In pythonw, stdout is None.
|
||||||
if sys.stdout is not None:
|
if sys.stdout is not None:
|
||||||
output(sys.stdout, line, end=end)
|
output(sys.stdout, line, end=end)
|
||||||
|
|
||||||
def stderr(line='', end='\n'):
|
def stderr(line='', end='\n'):
|
||||||
|
line = line.replace('\r\n', '\n')
|
||||||
# In pythonw, stderr is None.
|
# In pythonw, stderr is None.
|
||||||
if sys.stderr is not None:
|
if sys.stderr is not None:
|
||||||
output(sys.stderr, line, end=end)
|
output(sys.stderr, line, end=end)
|
||||||
|
|
Loading…
Reference in a new issue