File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ def __init__(
5353 self .path_to_database = path_to_database
5454
5555 if os .path .exists (path_to_database ):
56- self ._file = h5py .File (path_to_database , mode = "r+" )
56+ try :
57+ self ._file = h5py .File (path_to_database , mode = "r+" )
58+ except OSError :
59+ self ._file = h5py .File (path_to_database , mode = "r" )
5760 else :
5861 self ._file = None
5962
@@ -315,7 +318,10 @@ def create(
315318 patients_data_extractor .close ()
316319 patients_data_extractor .reset ()
317320
318- self ._file = h5py .File (self .path_to_database , "r+" )
321+ try :
322+ self ._file = h5py .File (self .path_to_database , mode = "r+" )
323+ except OSError :
324+ self ._file = h5py .File (self .path_to_database , mode = "r" )
319325
320326 return patients_data_extractor .patients_who_failed
321327
You can’t perform that action at this time.
0 commit comments