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,13 +7,24 @@ from typing import List, Optional
import discord # type: ignore import discord # type: ignore
from urllib.parse import urlparse from urllib.parse import urlparse
from ..processor.constants import ( try:
# Try relative imports first
from ..processor.constants import (
REACTIONS, REACTIONS,
ReactionType, ReactionType,
get_reaction, get_reaction,
get_progress_emoji, get_progress_emoji,
) )
from ..database.video_archive_db import VideoArchiveDB 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") logger = logging.getLogger("VideoArchiver")