From 7e1f617274a06756e5a0c1cf278e0a1d8a225969 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sun, 28 Jul 2024 20:21:02 -0700 Subject: [PATCH] fix bug where use_mmap was ignored --- masque/file/gdsii.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/masque/file/gdsii.py b/masque/file/gdsii.py index a28979d..542fb86 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -597,7 +597,7 @@ def load_libraryfile( path = pathlib.Path(filename) stream: IO[bytes] if is_gzipped(path): - if mmap: + if use_mmap: logger.info('Asked to mmap a gzipped file, reading into memory instead...') gz_stream = gzip.open(path, mode='rb') stream = io.BytesIO(gz_stream.read()) # type: ignore @@ -605,7 +605,7 @@ def load_libraryfile( gz_stream = gzip.open(path, mode='rb') stream = io.BufferedReader(gz_stream) # type: ignore else: # noqa: PLR5501 - if mmap: + if use_mmap: base_stream = open(path, mode='rb', buffering=0) stream = mmap.mmap(base_stream.fileno(), 0, access=mmap.ACCESS_READ) # type: ignore else: