[gdsii] Try to close files if able
This commit is contained in:
parent
f42114bf43
commit
e261585894
1 changed files with 6 additions and 1 deletions
|
|
@ -617,7 +617,12 @@ def load_libraryfile(
|
|||
stream = mmap.mmap(base_stream.fileno(), 0, access=mmap.ACCESS_READ) # type: ignore
|
||||
else:
|
||||
stream = path.open(mode='rb') # noqa: SIM115
|
||||
return load_library(stream, full_load=full_load, postprocess=postprocess)
|
||||
|
||||
try:
|
||||
return load_library(stream, full_load=full_load, postprocess=postprocess)
|
||||
finally:
|
||||
if full_load:
|
||||
stream.close()
|
||||
|
||||
|
||||
def check_valid_names(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue