We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
nedbat
Learn more about funding links in repositories.
Report abuse
1 parent 4574ecf commit 021a99fCopy full SHA for 021a99f
coverage/types.py
@@ -29,7 +29,11 @@ class Protocol: # pylint: disable=missing-class-docstring
29
## File paths
30
31
# For arguments that are file paths:
32
-FilePath = Union[str, os.PathLike]
+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]
37
# For testing FilePath arguments
38
FilePathClasses = [str, pathlib.Path]
39
FilePathType = Union[Type[str], Type[pathlib.Path]]
0 commit comments