11import functools
22import pathlib
3- from typing import Dict , Protocol , Union , runtime_checkable
3+ from typing import Protocol , Union , runtime_checkable
44
55####
66# from jaraco.path 3.7.1
@@ -12,7 +12,7 @@ class Symlink(str):
1212 """
1313
1414
15- FilesSpec = Dict [str , Union [str , bytes , Symlink , 'FilesSpec' ]]
15+ FilesSpec = dict [str , Union [str , bytes , Symlink , 'FilesSpec' ]]
1616
1717
1818@runtime_checkable
@@ -28,13 +28,13 @@ def write_bytes(self, content): ... # pragma: no cover
2828 def symlink_to (self , target ): ... # pragma: no cover
2929
3030
31- def _ensure_tree_maker (obj : Union [ str , TreeMaker ] ) -> TreeMaker :
31+ def _ensure_tree_maker (obj : str | TreeMaker ) -> TreeMaker :
3232 return obj if isinstance (obj , TreeMaker ) else pathlib .Path (obj ) # type: ignore[return-value]
3333
3434
3535def build (
3636 spec : FilesSpec ,
37- prefix : Union [ str , TreeMaker ] = pathlib .Path (), # type: ignore[assignment]
37+ prefix : str | TreeMaker = pathlib .Path (), # type: ignore[assignment]
3838):
3939 """
4040 Build a set of files/directories, as described by the spec.
@@ -66,7 +66,7 @@ def build(
6666
6767
6868@functools .singledispatch
69- def create (content : Union [ str , bytes , FilesSpec ] , path ):
69+ def create (content : str | bytes | FilesSpec , path ):
7070 path .mkdir (exist_ok = True )
7171 build (content , prefix = path ) # type: ignore[arg-type]
7272
0 commit comments