exec_wrapper.py: sys.path fixup for test scripts
This commit is contained in:
parent
6c249dec5b
commit
31390cfa33
2 changed files with 3 additions and 6 deletions
|
|
@ -19,6 +19,7 @@ def exec_wrapper_init():
|
|||
exec_wrapper_sys.path[1] = cwd
|
||||
from test.overlay import get_overlay_tree_dir
|
||||
exec_wrapper_sys.path[0] = get_overlay_tree_dir(cwd)
|
||||
exec_wrapper_sys.path.insert(2, exec_wrapper_os.path.join(cwd,'test'))
|
||||
else:
|
||||
exec_wrapper_sys.path.pop(0)
|
||||
|
||||
|
|
|
|||
|
|
@ -85,12 +85,8 @@ if sys.argv[-1] == 'clean':
|
|||
print(f'Removed {os.path.relpath(overlay_tree_dir)!r}')
|
||||
else:
|
||||
# overlay must be set up before importing mmgen mods!
|
||||
try:
|
||||
import include.test_init
|
||||
repo_root = include.test_init.repo_root
|
||||
except ModuleNotFoundError: # allow running under exec_wrapper
|
||||
import test.include.test_init
|
||||
repo_root = test.include.test_init.repo_root
|
||||
import include.test_init
|
||||
repo_root = include.test_init.repo_root
|
||||
|
||||
from mmgen.common import *
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue