Skip to content

Commit

Permalink
fix is_running
Browse files Browse the repository at this point in the history
  • Loading branch information
dcfidalgo committed Nov 15, 2023
1 parent b11651e commit f42c7f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/slurm_sweeps/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def is_running() -> bool:
"""Are we running inside an `sbatch` call?"""
try:
subprocess.check_output(["sinfo"])
assert hasattr(os.environ, "SLURM_NTASKS")
assert "SLURM_NTASKS" in os.environ
except (FileNotFoundError, subprocess.CalledProcessError, AssertionError):
return False
else:
Expand Down

0 comments on commit f42c7f1

Please sign in to comment.