From 0bbcf3823ae309dd9580805fca3f6f6cc9bb3296 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 15 May 2019 00:11:28 -0700 Subject: [PATCH] Fix .gz suffix detection --- 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 bda7753..61c9f57 100644 --- a/masque/file/gdsii.py +++ b/masque/file/gdsii.py @@ -119,7 +119,7 @@ def writefile(patterns: List[Pattern] or Pattern, Will automatically compress the file if it has a .gz suffix. """ path = pathlib.Path(filename) - if path.suffix == 'gz': + if path.suffix == '.gz': open_func = gzip.open else: open_func = open @@ -213,7 +213,7 @@ def readfile(filename: str or pathlib.Path, Tries to autodetermine file type based on suffixes """ path = pathlib.Path(filename) - if path.suffix == 'gz': + if path.suffix == '.gz': open_func = gzip.open else: open_func = open