Skip to content

Commit

Permalink
Fix Python 3.8 regression
Browse files Browse the repository at this point in the history
  • Loading branch information
cpburnz committed Dec 9, 2023
1 parent 5fda810 commit 42bee76
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

from typing import (
Iterable, # Replaced by `collections.abc.Iterable` in 3.9.
Tuple, # Replaced by `collections.abc.Tuple` in 3.9.
List, # Replaced by `set` in 3.9.
Set, # Replaced by `set` in 3.9.
Tuple, # Replaced by `tuple` in 3.9.
cast)

from pathspec import (
Expand All @@ -31,7 +33,7 @@ def debug_results(spec: PathSpec, results: Iterable[CheckResult[str]]) -> str:
Returns the message (:class:`str`).
"""
patterns = cast(list[RegexPattern], spec.patterns)
patterns = cast(List[RegexPattern], spec.patterns)

pattern_table = []
for index, pattern in enumerate(patterns, 1):
Expand Down Expand Up @@ -70,7 +72,7 @@ def debug_results(spec: PathSpec, results: Iterable[CheckResult[str]]) -> str:
])


def get_includes(results: Iterable[CheckResult[TStrPath]]) -> set[TStrPath]:
def get_includes(results: Iterable[CheckResult[TStrPath]]) -> Set[TStrPath]:
"""
Get the included files from the check results.
Expand Down

0 comments on commit 42bee76

Please sign in to comment.