We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7383f3 commit 4fa9d62Copy full SHA for 4fa9d62
raito/core/routers/parser.py
@@ -1,5 +1,6 @@
1
from __future__ import annotations
2
3
+import sys
4
from importlib.util import module_from_spec, spec_from_file_location
5
from pathlib import Path
6
from typing import TYPE_CHECKING
@@ -46,7 +47,11 @@ def _load_module(cls, file_path: StrOrPath) -> object:
46
47
raise ModuleNotFoundError(msg)
48
49
module = module_from_spec(spec)
50
+ module.__name__ = spec.name
51
+ module.__file__ = str(file_path)
52
+ sys.modules[spec.name] = module
53
spec.loader.exec_module(module)
54
+
55
return module
56
57
@classmethod
0 commit comments