From 891007054f323bea7a34026fa46873f60be64be4 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 29 Jul 2024 18:00:54 -0700 Subject: [PATCH] use pathlibto validate path --- fatamorgana/test/build_testfiles.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fatamorgana/test/build_testfiles.py b/fatamorgana/test/build_testfiles.py index 0f85fce..50511ba 100644 --- a/fatamorgana/test/build_testfiles.py +++ b/fatamorgana/test/build_testfiles.py @@ -4,6 +4,7 @@ Build files equivalent to the test cases used by KLayout. from typing import IO from collections.abc import Callable +from pathlib import Path from . import ( @@ -16,8 +17,8 @@ from . import ( def build_file(num: str, func: Callable[[IO[bytes]], IO[bytes]]) -> None: - with open('t' + num + '.oas', 'wb') as f: - func(f) + with Path('t' + num + '.oas').open('wb') as ff: + func(ff) def write_all_files() -> None: