scripts/exec_wrapper.py: ensure loading of mmgen mods from overlay

This commit is contained in:
The MMGen Project 2024-08-26 13:47:02 +00:00
commit 10cc89feac
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2

View file

@ -27,8 +27,11 @@ def exec_wrapper_init():
if exec_wrapper_os.path.dirname(exec_wrapper_sys.argv[1]) == 'test':
# support running of test scripts under wrapper
exec_wrapper_sys.path[0] = exec_wrapper_os.getcwd() # assume we’re in repo root
exec_wrapper_sys.path.insert(0,exec_wrapper_os.path.join('test', 'overlay', 'tree'))
repo_root = exec_wrapper_os.getcwd() # assume we’re in repo root
exec_wrapper_sys.path[0] = repo_root
# ensure loading of mmgen mods from overlay tree, not repo root:
from test.overlay import overlay_setup
overlay_setup(repo_root)
else:
exec_wrapper_sys.path.pop(0)