fix(processor): add fallback to absolute imports in reactions.py

This commit is contained in:
pacnpal
2024-11-17 22:57:04 +00:00
parent d1cc32a1da
commit d6f6800399

View File

@@ -7,6 +7,8 @@ from typing import List, Optional
import discord # type: ignore
from urllib.parse import urlparse
try:
# Try relative imports first
from ..processor.constants import (
REACTIONS,
ReactionType,
@@ -14,6 +16,15 @@ from ..processor.constants import (
get_progress_emoji,
)
from ..database.video_archive_db import VideoArchiveDB
except ImportError:
# Fall back to absolute imports if relative imports fail
from videoarchiver.processor.constants import (
REACTIONS,
ReactionType,
get_reaction,
get_progress_emoji,
)
from videoarchiver.database.video_archive_db import VideoArchiveDB
logger = logging.getLogger("VideoArchiver")