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 cleanup.py
This commit is contained in:
@@ -8,15 +8,20 @@ from enum import Enum, auto
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Dict, Any, Optional, TypedDict, ClassVar
|
from typing import TYPE_CHECKING, Dict, Any, Optional, TypedDict, ClassVar
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Try relative imports first
|
||||||
from ..utils.file_ops import cleanup_downloads
|
from ..utils.file_ops import cleanup_downloads
|
||||||
from ..utils.exceptions import (
|
from ..utils.exceptions import CleanupError, ErrorContext, ErrorSeverity
|
||||||
CleanupError,
|
except ImportError:
|
||||||
ErrorContext,
|
# Fall back to absolute imports if relative imports fail
|
||||||
ErrorSeverity
|
from videoarchiver.utils.file_ops import cleanup_downloads
|
||||||
)
|
from videoarchiver.utils.exceptions import CleanupError, ErrorContext, ErrorSeverity
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
try:
|
||||||
from .base import VideoArchiver
|
from .base import VideoArchiver
|
||||||
|
except ImportError:
|
||||||
|
from videoarchiver.core.base import VideoArchiver
|
||||||
|
|
||||||
logger = logging.getLogger("VideoArchiver")
|
logger = logging.getLogger("VideoArchiver")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user