Skip to content
Snippets Groups Projects
Commit 5c286a45 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

put file open in an exception

parent 863fb8ad
No related branches found
No related tags found
No related merge requests found
...@@ -27,11 +27,11 @@ class HPC(condor,slurm): ...@@ -27,11 +27,11 @@ class HPC(condor,slurm):
""" """
if joinlist is None: if joinlist is None:
joinlist = self.grid_options['joinlist'] joinlist = self.grid_options['joinlist']
f = open(joinlist,'r',encoding='utf-8') try:
if f: f = open(joinlist,'r',encoding='utf-8')
list = f.read().splitlines() list = f.read().splitlines()
f.close() f.close()
else: except:
print("Failed to open joinlist at {list}".format(list=joinlist)) print("Failed to open joinlist at {list}".format(list=joinlist))
self.exit(code=1) self.exit(code=1)
return list return list
......
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