Minor: Print filename when missing in distributed.py
* Minor: Print filename when missing in distributed.py
...when you have a script that potentially includes file operations (ex when opening a file to load data for a task), this piece of code will eat the filename if it's missing.
* pre commit lint
@@ -356,9 +356,11 @@ def slurm_distributed_context(opt):
except subprocess.CalledProcessError as e:
# scontrol failed
raise e
- except FileNotFoundError:
+ except FileNotFoundError as e:
# Slurm is not installed
- raise RuntimeError('SLURM does not appear to be installed.')
+ raise RuntimeError(
+ 'SLURM does not appear to be installed. Missing file: ' + e.filename
+ )
def find_free_port() -> int:
