Fix plugin imports: use proper relative imports instead of spec_from_file_location hack
This commit is contained in:
parent
008be764a7
commit
598a768f0a
1 changed files with 1 additions and 8 deletions
|
|
@ -13,14 +13,7 @@ from datetime import datetime, timezone
|
||||||
|
|
||||||
from cardinal.decorators import command, event, help
|
from cardinal.decorators import command, event, help
|
||||||
|
|
||||||
# Import parser from same directory
|
from .monop_parser import MonopParser
|
||||||
import os
|
|
||||||
import importlib.util
|
|
||||||
_parser_path = os.path.join(os.path.dirname(__file__), "monop_parser.py")
|
|
||||||
_spec = importlib.util.spec_from_file_location("monop_parser", _parser_path)
|
|
||||||
_mod = importlib.util.module_from_spec(_spec)
|
|
||||||
_spec.loader.exec_module(_mod)
|
|
||||||
MonopParser = _mod.MonopParser
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue