use pathlibto validate path

This commit is contained in:
Jan Petykiewicz 2024-07-29 18:00:54 -07:00
parent 5011750637
commit 891007054f

View File

@ -4,6 +4,7 @@ Build files equivalent to the test cases used by KLayout.
from typing import IO from typing import IO
from collections.abc import Callable from collections.abc import Callable
from pathlib import Path
from . import ( from . import (
@ -16,8 +17,8 @@ from . import (
def build_file(num: str, func: Callable[[IO[bytes]], IO[bytes]]) -> None: def build_file(num: str, func: Callable[[IO[bytes]], IO[bytes]]) -> None:
with open('t' + num + '.oas', 'wb') as f: with Path('t' + num + '.oas').open('wb') as ff:
func(f) func(ff)
def write_all_files() -> None: def write_all_files() -> None: