u2cli: aggressive flushing on windows

This commit is contained in:
ed 2021-10-18 20:35:50 +02:00
parent 23c8d3d045
commit 1faff2a37e

View file

@ -125,17 +125,30 @@ class FileSlice(object):
return ret
_print = print
def eprint(*a, **ka):
ka["file"] = sys.stderr
ka["end"] = ""
if not PY2:
ka["flush"] = True
print(*a, **ka)
if PY2:
_print(*a, **ka)
if PY2 or not VT100:
sys.stderr.flush()
def flushing_print(*a, **ka):
_print(*a, **ka)
if "flush" not in ka:
sys.stdout.flush()
if not VT100:
print = flushing_print
def termsize():
import os