From 87007af5f8d45c99fb1ff17a1284c1e9b6e52dfb Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 9 Sep 2024 23:35:07 +0200 Subject: [PATCH] Pass package path to importlib call, not module path --- service/jargon/resources.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/jargon/resources.py b/service/jargon/resources.py index 5bdf4f798..61186ef1c 100644 --- a/service/jargon/resources.py +++ b/service/jargon/resources.py @@ -19,6 +19,7 @@ from importlib.resources import files -DEFAULT_DATA = files(__name__).joinpath('defaults.yaml').open('r', encoding='utf8').read() -DEFAULT_HEADER = files(__name__).joinpath('header.yaml').open('r', encoding='utf8').read() +PACKAGE_NAME = __name__.rsplit(".", maxsplit=1)[0] +DEFAULT_DATA = files(PACKAGE_NAME).joinpath('defaults.yaml').open('r', encoding='utf8').read() +DEFAULT_HEADER = files(PACKAGE_NAME).joinpath('header.yaml').open('r', encoding='utf8').read()