From 940dab8f2ab5092a761dd5ba38e9a1c0afc0b765 Mon Sep 17 00:00:00 2001 From: KotlinIsland Date: Fri, 3 Mar 2023 11:37:25 +1000 Subject: [PATCH] fix: Remove missing type parameter --- coverage/types.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coverage/types.py b/coverage/types.py index e01f451e6..828ab20bb 100644 --- a/coverage/types.py +++ b/coverage/types.py @@ -29,7 +29,11 @@ class Protocol: # pylint: disable=missing-class-docstring ## File paths # For arguments that are file paths: -FilePath = Union[str, os.PathLike] +if TYPE_CHECKING: + FilePath = Union[str, os.PathLike[str]] +else: + # PathLike < python3.9 doesn't support subscription + FilePath = Union[str, os.PathLike] # For testing FilePath arguments FilePathClasses = [str, pathlib.Path] FilePathType = Union[Type[str], Type[pathlib.Path]]