pass E.pkg as module object for importlib_resources compatibility

This commit is contained in:
Shiz 2024-09-17 12:13:05 +02:00
parent 0ce389f02a
commit ee4bf22ec2
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ except:
class EnvParams(object):
def __init__(self) -> None:
self.pkg = ""
self.pkg = None
self.t0 = time.time()
self.mod = ""
self.cfg = ""

View File

@ -217,7 +217,7 @@ def init_E(EE: EnvParams) -> None:
raise Exception("could not find a writable path for config")
E.pkg = __package__
E.pkg = sys.modules[__package__]
E.mod = os.path.dirname(os.path.realpath(__file__))
if E.mod.endswith("__init__"):
E.mod = os.path.dirname(E.mod)