mirror of
https://github.com/pacnpal/Pac-cogs.git
synced 2025-12-20 10:51:05 -05:00
fix(core): add fallback to absolute imports in guild.py
This commit is contained in:
@@ -4,13 +4,24 @@ import logging
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Dict, Any, Optional
|
from typing import TYPE_CHECKING, Dict, Any, Optional
|
||||||
|
|
||||||
from ..utils.download_core import DownloadCore
|
try:
|
||||||
from ..utils.message_manager import MessageManager
|
# Try relative imports first
|
||||||
from ..utils.file_ops import cleanup_downloads
|
from ..utils.download_core import DownloadCore
|
||||||
from ..utils.exceptions import VideoArchiverError as ProcessingError
|
from ..utils.message_manager import MessageManager
|
||||||
|
from ..utils.file_ops import cleanup_downloads
|
||||||
|
from ..utils.exceptions import VideoArchiverError as ProcessingError
|
||||||
|
except ImportError:
|
||||||
|
# Fall back to absolute imports if relative imports fail
|
||||||
|
from videoarchiver.utils.download_core import DownloadCore
|
||||||
|
from videoarchiver.utils.message_manager import MessageManager
|
||||||
|
from videoarchiver.utils.file_ops import cleanup_downloads
|
||||||
|
from videoarchiver.utils.exceptions import VideoArchiverError as ProcessingError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ..core.base import VideoArchiver
|
try:
|
||||||
|
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