Skip to content

Commit

Permalink
FIX: Raise FileNotFoundError if in interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
d-krupke committed Feb 27, 2024
1 parent f742aad commit 2722fc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/slurminade/function_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def set_entry_point(entry_point: typing.Union[str, pathlib.Path]) -> None:
def get_entry_point() -> Path:
if FunctionMap.entry_point is None:
import __main__
# check if attribute __file__ is available
if not hasattr(__main__, "__file__"):
raise FileNotFoundError("No entry point known.")

entry_point = __main__.__file__

Expand Down

0 comments on commit 2722fc2

Please sign in to comment.