Skip to content
Snippets Groups Projects
Commit 3b82062d authored by Johannes Schmölder's avatar Johannes Schmölder
Browse files

Change directory when running study

parent 684a9a34
No related branches found
No related tags found
1 merge request!3Change directory when running study
Pipeline #134591 passed
import importlib
import os
from pathlib import Path
import sys
......@@ -126,6 +127,9 @@ class Case:
return
try:
cur_dir = os.getcwd()
os.chdir(self.study.path)
sys.path.append(str(self.study.path))
module = importlib.import_module(self.study.name)
......@@ -137,6 +141,7 @@ class Case:
self.status = 'finished'
sys.path.remove(str(self.study.path))
os.chdir(cur_dir)
except (KeyboardInterrupt, Exception) as e:
print(f"Command execution failed: {e}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment