mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 02:41:06 -05:00
fix(core): add fallback to absolute imports in lifecycle.py
This commit is contained in:
@@ -7,7 +7,9 @@ from typing import Optional, Dict, Any, Set, List, Callable, TypedDict, ClassVar
|
||||
from enum import Enum, auto
|
||||
from datetime import datetime
|
||||
|
||||
from ..core.cleanup import cleanup_resources, force_cleanup_resources
|
||||
try:
|
||||
# Try relative imports first
|
||||
from .cleanup import cleanup_resources, force_cleanup_resources
|
||||
from ..utils.exceptions import (
|
||||
VideoArchiverError,
|
||||
ErrorContext,
|
||||
@@ -15,6 +17,16 @@ from ..utils.exceptions import (
|
||||
ComponentError,
|
||||
CleanupError,
|
||||
)
|
||||
except ImportError:
|
||||
# Fall back to absolute imports if relative imports fail
|
||||
from videoarchiver.core.cleanup import cleanup_resources, force_cleanup_resources
|
||||
from videoarchiver.utils.exceptions import (
|
||||
VideoArchiverError,
|
||||
ErrorContext,
|
||||
ErrorSeverity,
|
||||
ComponentError,
|
||||
CleanupError,
|
||||
)
|
||||
|
||||
logger = logging.getLogger("VideoArchiver")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user