Minor patch for #5255

This commit is contained in:
Miroslav Stampar
2022-12-12 15:24:27 +01:00
parent 33a6547f5b
commit ebaee3a4e6
3 changed files with 9 additions and 3 deletions

View File

@@ -1034,7 +1034,10 @@ def dataToStdout(data, forceOutput=False, bold=False, contentType=None, status=C
except UnicodeEncodeError:
sys.stdout.write(re.sub(r"[^ -~]", '?', clearColors(data)))
finally:
sys.stdout.flush()
try:
sys.stdout.flush()
except IOError:
raise SystemExit
if multiThreadMode:
logging._releaseLock()