Skip to content

Commit

Permalink
Merge pull request #187 from glotzerlab/fix/close-collection-on-error
Browse files Browse the repository at this point in the history
Ensure that collection file is closed. Resolves #186.
  • Loading branch information
csadorf committed May 14, 2019
2 parents 0a16292 + 2a8f3cd commit 39cafbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions signac/contrib/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ def _open(cls, file, compresslevel=0):
else:
raise error
except ValueError as error:
file.close()
if hasattr(file, 'name'):
raise JSONParseError(
"Error while trying to parse file '{}': {}.".format(file.name, error))
Expand Down

0 comments on commit 39cafbe

Please sign in to comment.