mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 15:28:27 +01:00
ui: flush stdout/stderr before colorama re-init
This commit is contained in:
committed by
Peter Rowlands (변기호)
parent
2d820cccad
commit
440cb9d2bc
@@ -31,10 +31,16 @@ if TYPE_CHECKING:
|
||||
|
||||
@contextmanager
|
||||
def disable_colorama():
|
||||
import sys
|
||||
|
||||
colorama.deinit()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if sys.stdout:
|
||||
sys.stdout.flush()
|
||||
if sys.stderr:
|
||||
sys.stderr.flush()
|
||||
colorama.reinit()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user