From d6f680039970141e8c606d90f45d7563df0072b8 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Sun, 17 Nov 2024 22:57:04 +0000 Subject: [PATCH] fix(processor): add fallback to absolute imports in reactions.py --- videoarchiver/processor/reactions.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/videoarchiver/processor/reactions.py b/videoarchiver/processor/reactions.py index 84aba27..a168cfc 100644 --- a/videoarchiver/processor/reactions.py +++ b/videoarchiver/processor/reactions.py @@ -7,13 +7,24 @@ from typing import List, Optional import discord # type: ignore from urllib.parse import urlparse -from ..processor.constants import ( - REACTIONS, - ReactionType, - get_reaction, - get_progress_emoji, -) -from ..database.video_archive_db import VideoArchiveDB +try: + # Try relative imports first + from ..processor.constants import ( + REACTIONS, + ReactionType, + get_reaction, + 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")