mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 18:02:58 +08:00
fix: exception handling for handle_stream
This commit is contained in:
parent
59a2ce177d
commit
458f1f6817
10
__init__.py
10
__init__.py
@ -9,9 +9,13 @@ import re
|
|||||||
from tqdm.auto import tqdm
|
from tqdm.auto import tqdm
|
||||||
from git.remote import RemoteProgress
|
from git.remote import RemoteProgress
|
||||||
|
|
||||||
|
|
||||||
def handle_stream(stream, prefix):
|
def handle_stream(stream, prefix):
|
||||||
for line in stream:
|
try:
|
||||||
print(prefix, line, end="")
|
for line in stream:
|
||||||
|
print(prefix, line, end="")
|
||||||
|
except Exception:
|
||||||
|
print("[!] ??? log decoding error ???")
|
||||||
|
|
||||||
|
|
||||||
def run_script(cmd, cwd='.'):
|
def run_script(cmd, cwd='.'):
|
||||||
@ -58,7 +62,7 @@ sys.path.append('../..')
|
|||||||
from torchvision.datasets.utils import download_url
|
from torchvision.datasets.utils import download_url
|
||||||
|
|
||||||
# ensure .js
|
# ensure .js
|
||||||
print("### Loading: ComfyUI-Manager (V0.38)")
|
print("### Loading: ComfyUI-Manager (V0.38.1)")
|
||||||
|
|
||||||
comfy_ui_required_revision = 1240
|
comfy_ui_required_revision = 1240
|
||||||
comfy_ui_revision = "Unknown"
|
comfy_ui_revision = "Unknown"
|
||||||
|
|||||||
@ -25,8 +25,11 @@ git_script_path = os.path.join(comfyui_manager_path, "git_helper.py")
|
|||||||
|
|
||||||
|
|
||||||
def handle_stream(stream, prefix):
|
def handle_stream(stream, prefix):
|
||||||
for msg in stream:
|
try:
|
||||||
print(prefix, msg, end="")
|
for msg in stream:
|
||||||
|
print(prefix, msg, end="")
|
||||||
|
except Exception:
|
||||||
|
print("[!] ??? log decoding error ???")
|
||||||
|
|
||||||
|
|
||||||
def process_wrap(cmd_str, cwd_path, handler=None):
|
def process_wrap(cmd_str, cwd_path, handler=None):
|
||||||
@ -147,11 +150,14 @@ if os.path.exists(restore_snapshot_path):
|
|||||||
cloned_repos = []
|
cloned_repos = []
|
||||||
|
|
||||||
def msg_capture(stream, prefix):
|
def msg_capture(stream, prefix):
|
||||||
for msg in stream:
|
try:
|
||||||
if msg.startswith("CLONE: "):
|
for msg in stream:
|
||||||
cloned_repos.append(msg[7:])
|
if msg.startswith("CLONE: "):
|
||||||
|
cloned_repos.append(msg[7:])
|
||||||
|
|
||||||
print(prefix, msg, end="")
|
print(prefix, msg, end="")
|
||||||
|
except Exception:
|
||||||
|
print("[!] [snapshot restore] ??? log decoding error ???")
|
||||||
|
|
||||||
print(f"[ComfyUI-Manager] Restore snapshot.")
|
print(f"[ComfyUI-Manager] Restore snapshot.")
|
||||||
cmd_str = [sys.executable, git_script_path, '--apply-snapshot', restore_snapshot_path]
|
cmd_str = [sys.executable, git_script_path, '--apply-snapshot', restore_snapshot_path]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user