mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 02:12:58 +08:00
AttributeError fix (#1672)
This commit is contained in:
parent
d6295a00e6
commit
4b904934ef
@ -23,15 +23,18 @@ import folder_paths
|
|||||||
|
|
||||||
manager_util.add_python_path_to_env()
|
manager_util.add_python_path_to_env()
|
||||||
|
|
||||||
import datetime
|
import datetime as dt
|
||||||
if hasattr(datetime, 'datetime'):
|
|
||||||
from datetime import datetime
|
if hasattr(dt, 'datetime'):
|
||||||
|
from datetime import datetime as dt_datetime
|
||||||
|
|
||||||
def current_timestamp():
|
def current_timestamp():
|
||||||
return datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
return dt_datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
|
||||||
else:
|
else:
|
||||||
# NOTE: Occurs in some Mac environments.
|
# NOTE: Occurs in some Mac environments.
|
||||||
import time
|
import time
|
||||||
logging.error(f"[ComfyUI-Manager] fallback timestamp mode\n datetime module is invalid: '{datetime.__file__}'")
|
logging.error(f"[ComfyUI-Manager] fallback timestamp mode\n datetime module is invalid: '{dt.__file__}'")
|
||||||
|
|
||||||
def current_timestamp():
|
def current_timestamp():
|
||||||
return str(time.time()).split('.')[0]
|
return str(time.time()).split('.')[0]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user