Skip to content

Commit

Permalink
Back out changes to tests._path
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 11, 2024
1 parent 04c6983 commit afa39e8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ def symlink_to(self, target): ... # pragma: no cover


def _ensure_tree_maker(obj: Union[str, TreeMaker]) -> TreeMaker:
return obj if isinstance(obj, TreeMaker) else pathlib.Path(obj) # type: ignore[return-value] # jaraco/jaraco.path#4
return obj if isinstance(obj, TreeMaker) else pathlib.Path(obj) # type: ignore[return-value]


def build(
spec: FilesSpec,
prefix: Union[str, TreeMaker] = pathlib.Path(), # type: ignore[assignment] # jaraco/jaraco.path#4
prefix: Union[str, TreeMaker] = pathlib.Path(), # type: ignore[assignment]
):
"""
Build a set of files/directories, as described by the spec.
Expand Down Expand Up @@ -67,8 +67,7 @@ def build(
@functools.singledispatch
def create(content: Union[str, bytes, FilesSpec], path):
path.mkdir(exist_ok=True)
# Mypy only looks at the signature of the main singledispatch method. So it must contain the complete Union
build(content, prefix=path) # type: ignore[arg-type] # python/mypy#11727
build(content, prefix=path) # type: ignore[arg-type]


@create.register
Expand Down

0 comments on commit afa39e8

Please sign in to comment.