Skip to content

Commit d1969e1

Browse files
committed
refactor: replace return False with RuntimeError for PYTHONPATH check
1 parent a57040e commit d1969e1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/wrappers/OsipiBase.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,10 @@ def osipi_initiate_algorithm(self, algorithm, **kwargs):
154154
# Import the algorithm
155155
root_path = pathlib.Path(__file__).resolve().parents[2]
156156
if str(root_path) not in sys.path:
157-
print("Root folder not in PYTHONPATH")
158-
return False
157+
raise RuntimeError(
158+
"Root folder not found in PYTHONPATH. "
159+
"Please ensure the project root is in sys.path."
160+
)
159161

160162
# ------------------------------------------------------------------
161163
# Validate algorithm name against available modules in src/standardized/

0 commit comments

Comments
 (0)