Skip to content

Commit de33ff0

Browse files
committed
fix: Remove missing type parameter
1 parent 499f4f5 commit de33ff0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

coverage/types.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from types import FrameType, ModuleType
1414
from typing import (
1515
Any, Callable, Dict, Iterable, List, Mapping, Optional, Set, Tuple, Type, Union,
16-
TYPE_CHECKING,
16+
TYPE_CHECKING, AnyStr,
1717
)
1818

1919
if TYPE_CHECKING:
@@ -29,7 +29,11 @@ class Protocol: # pylint: disable=missing-class-docstring
2929
## File paths
3030

3131
# For arguments that are file paths:
32-
FilePath = Union[str, os.PathLike]
32+
if TYPE_CHECKING:
33+
FilePath = Union[str, os.PathLike[str]]
34+
else:
35+
# PathLike < python3.9 doesn't support subscription
36+
FilePath = Union[str, os.PathLike]
3337
# For testing FilePath arguments
3438
FilePathClasses = [str, pathlib.Path]
3539
FilePathType = Union[Type[str], Type[pathlib.Path]]

0 commit comments

Comments
 (0)