Skip to content

Commit

Permalink
Merge pull request #263 from alhom/vlsvreader_destructor_guard
Browse files Browse the repository at this point in the history
vlsvreader destructor guard for nonexisting fptr
  • Loading branch information
alhom committed Aug 26, 2024
2 parents d7ff7ba + 8caa42d commit 7b806a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyVlsv/vlsvreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ class MeshInfo:

file_name=""
def __del__(self):
self.__fptr.close()
if (hasattr(self, "__fptr")) and self.__fptr is not None:
self.__fptr.close()

def __init__(self, file_name, fsGridDecomposition=None):
''' Initializes the vlsv file (opens the file, reads the file footer and reads in some parameters)
Expand Down

0 comments on commit 7b806a0

Please sign in to comment.