mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-05-14 19:07:28 +08:00
Merge 5ea9410914 into 7a8fc44f90
This commit is contained in:
commit
158b8a3b12
@ -332,8 +332,14 @@ try:
|
|||||||
if '100%' in message:
|
if '100%' in message:
|
||||||
self.sync_write(message)
|
self.sync_write(message)
|
||||||
else:
|
else:
|
||||||
write_stderr(message)
|
# Wrap flush() to match the safer behaviour of
|
||||||
original_stderr.flush()
|
# self.flush() below — a broken pipe must not
|
||||||
|
# kill the calling print() (and thus the node).
|
||||||
|
try:
|
||||||
|
write_stderr(message)
|
||||||
|
original_stderr.flush()
|
||||||
|
except (OSError, ValueError):
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
self.sync_write(message)
|
self.sync_write(message)
|
||||||
else:
|
else:
|
||||||
@ -356,12 +362,20 @@ try:
|
|||||||
|
|
||||||
if not file_only:
|
if not file_only:
|
||||||
with std_log_lock:
|
with std_log_lock:
|
||||||
if self.is_stdout:
|
# Wrap flush() in try/except to match self.flush()
|
||||||
write_stdout(message)
|
# below. Without this, an OSError from a broken
|
||||||
original_stdout.flush()
|
# stdio pipe (e.g. Windows [Errno 22] Invalid argument)
|
||||||
else:
|
# propagates up through every print() call in every
|
||||||
write_stderr(message)
|
# custom node, killing prompt execution.
|
||||||
original_stderr.flush()
|
try:
|
||||||
|
if self.is_stdout:
|
||||||
|
write_stdout(message)
|
||||||
|
original_stdout.flush()
|
||||||
|
else:
|
||||||
|
write_stderr(message)
|
||||||
|
original_stderr.flush()
|
||||||
|
except (OSError, ValueError):
|
||||||
|
pass
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user