load_modules is depreciated

This commit is contained in:
2021-01-19 19:05:07 +01:00
parent 686a218ed0
commit 925c94c63e
184 changed files with 920 additions and 184 deletions

View File

@ -26,7 +26,11 @@ class TiramisuReflector:
):
self.index = 0
self.text = ["from importlib.machinery import SourceFileLoader",
f"func = SourceFileLoader('func', '{funcs_path}').load_module()",
"from importlib.util import spec_from_loader, module_from_spec",
f"loader = SourceFileLoader('func', '{funcs_path}')",
"spec = spec_from_loader(loader.name, loader)",
"func = module_from_spec(spec)",
"loader.exec_module(func)",
"for key, value in dict(locals()).items():",
" if key != ['SourceFileLoader', 'func']:",
" setattr(func, key, value)",