Skip to content

Commit

Permalink
Merge pull request #98 from nlesc-nano/devel
Browse files Browse the repository at this point in the history
Added a try/except clause for job hashing in case rerun prevention is disabled
  • Loading branch information
BvB93 committed Apr 2, 2020
2 parents 00f722d + f01091c commit 945ebb4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CAT/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@ def _finalize(self):
self.status = 'successful'
if self.settings.pickle:
self.pickle()
filename = join(self.path, self.name + '.hash')
filename = join(self.path, f'{self.name}.hash')
with open(filename, 'w') as f:
f.write(self.hash())
try: # Will raise a TypeError if rerun prevetion is disabled
f.write(self.hash())
except TypeError:
pass
else:
self.status = 'failed'
else:
Expand Down

0 comments on commit 945ebb4

Please sign in to comment.