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,14 +7,26 @@ from typing import Optional, Dict, Any, Set, List, Callable, TypedDict, ClassVar
|
|||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from ..core.cleanup import cleanup_resources, force_cleanup_resources
|
try:
|
||||||
from ..utils.exceptions import (
|
# Try relative imports first
|
||||||
VideoArchiverError,
|
from .cleanup import cleanup_resources, force_cleanup_resources
|
||||||
ErrorContext,
|
from ..utils.exceptions import (
|
||||||
ErrorSeverity,
|
VideoArchiverError,
|
||||||
ComponentError,
|
ErrorContext,
|
||||||
CleanupError,
|
ErrorSeverity,
|
||||||
)
|
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")
|
logger = logging.getLogger("VideoArchiver")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user