diff --git a/edalize/templates/vunit/run.py.j2 b/edalize/templates/vunit/run.py.j2 index bd43e4f7b..2ccaf4bfd 100644 --- a/edalize/templates/vunit/run.py.j2 +++ b/edalize/templates/vunit/run.py.j2 @@ -1,17 +1,21 @@ # Auto generated by Edalize + def load_module_from_file(name, python_file): import importlib.util + spec = importlib.util.spec_from_file_location(name, python_file) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) return module -def load_runner_hooks(python_file = r'{{ vunit_runner_path }}'): + +def load_runner_hooks(python_file=r"{{ vunit_runner_path }}"): if len(python_file) > 0: - return load_module_from_file('vunit_runner_hooks', python_file) + return load_module_from_file("vunit_runner_hooks", python_file) else: - return __import__('edalize.vunit_hooks', fromlist=['vunit_hooks']) + return __import__("edalize.vunit_hooks", fromlist=["vunit_hooks"]) + runner = load_runner_hooks().VUnitRunner()