slightly cleaner
This commit is contained in:
@ -1,10 +1,10 @@
|
|||||||
import sys
|
import sys
|
||||||
import importlib.util
|
import importlib.util as ilu
|
||||||
|
|
||||||
|
|
||||||
def load_module(module_name, file_path):
|
def load_module(module_name, file_path):
|
||||||
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
spec = ilu.spec_from_file_location(module_name, file_path)
|
||||||
module = importlib.util.module_from_spec(spec)
|
module = ilu.module_from_spec(spec)
|
||||||
sys.modules[module_name] = module
|
sys.modules[module_name] = module
|
||||||
spec.loader.exec_module(module)
|
spec.loader.exec_module(module)
|
||||||
return module
|
return module
|
||||||
|
Reference in New Issue
Block a user