Skip to content

Commit

Permalink
fixed: datetime.datetime crash - use hasattr instead of exception h…
Browse files Browse the repository at this point in the history
…andling

#1503
  • Loading branch information
ltdrdata committed Feb 1, 2025
1 parent 4760dea commit 1a7edf7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion glob/manager_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from node_package import InstalledNodePackage


version_code = [3, 12]
version_code = [3, 12, 1]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')


Expand Down
10 changes: 5 additions & 5 deletions prestartup_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import manager_downloader
import folder_paths

try:
from datetime import datetime
import datetime
if hasattr(datetime, 'datetime'):
def current_timestamp():
return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
except:
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
else:
# NOTE: Occurs in some Mac environments.
import time
import datetime
logging.error(f"[ComfyUI-Manager] fallback timestamp mode\n datetime module is invalid: '{datetime.__file__}'")
def current_timestamp():
return str(time.time()).split('.')[0]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-manager"
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
version = "3.12"
version = "3.12.1"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]

Expand Down

0 comments on commit 1a7edf7

Please sign in to comment.