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