mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 18:02:58 +08:00
fixed: datetime.datetime crash - use hasattr instead of exception handling
https://github.com/ltdrdata/ComfyUI-Manager/issues/1503
This commit is contained in:
parent
4760deaf9c
commit
1a7edf7f0e
@ -41,7 +41,7 @@ import manager_downloader
|
||||
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 '')
|
||||
|
||||
|
||||
|
||||
@ -20,13 +20,13 @@ import cm_global
|
||||
import manager_downloader
|
||||
import folder_paths
|
||||
|
||||
try:
|
||||
from datetime import datetime
|
||||
def current_timestamp():
|
||||
return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
||||
except:
|
||||
import time
|
||||
import datetime
|
||||
if hasattr(datetime, 'datetime'):
|
||||
def current_timestamp():
|
||||
return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
||||
else:
|
||||
# NOTE: Occurs in some Mac environments.
|
||||
import time
|
||||
logging.error(f"[ComfyUI-Manager] fallback timestamp mode\n datetime module is invalid: '{datetime.__file__}'")
|
||||
def current_timestamp():
|
||||
return str(time.time()).split('.')[0]
|
||||
|
||||
@ -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"]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user