forked from jan/fatamorgana
use pathlibto validate path
This commit is contained in:
parent
5011750637
commit
891007054f
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user