Skip to content

Commit

Permalink
Fix os.PathLike type annotation
Browse files Browse the repository at this point in the history
This changes the `os.PathLike[Any]` annotation to `os.PathLike`. `os.PathLike` isn't subscriptable in Python 3.8, so 
`os.PathLike[Any]` results in `TypeError: 'ABCMeta' object is not subscriptable`.
  • Loading branch information
helenlyang authored Feb 28, 2024
1 parent 92d1eed commit a1eda26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions truss/util/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from distutils.dir_util import remove_tree
from distutils.file_util import copy_file
from pathlib import Path
from typing import Any, Iterable, Iterator, List, Optional, Set, Tuple, Union
from typing import Iterable, Iterator, List, Optional, Set, Tuple, Union

import pathspec

Expand Down Expand Up @@ -140,9 +140,9 @@ def is_ignored(


def get_ignored_relative_paths(
root_relative_paths: Iterable[Union[str, os.PathLike[Any]]],
root_relative_paths: Iterable[Union[str, os.PathLike]],
ignore_patterns: Optional[List[str]] = None,
) -> Iterator[Union[str, os.PathLike[Any]]]:
) -> Iterator[Union[str, os.PathLike]]:
"""Given an iterable of relative paths, returns an iterator of the relative paths that match ignore_patterns."""
if ignore_patterns is None:
return iter([])
Expand Down

0 comments on commit a1eda26

Please sign in to comment.