summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKotlinIsland <65446343+KotlinIsland@users.noreply.github.com>2023-03-15 20:45:27 +1000
committerGitHub <noreply@github.com>2023-03-15 03:45:27 -0700
commit021a99f3f50eca77abb85e2f25f26af65ad06128 (patch)
treed1e776b853df1ac7b793f8c12719255b1aa531a5
parent4574ecf128ae51c2b950f6c9cb2486b86f5354e7 (diff)
downloadpython-coveragepy-git-021a99f3f50eca77abb85e2f25f26af65ad06128.tar.gz
fix: Remove missing type parameter (#1570)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
-rw-r--r--coverage/types.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/types.py b/coverage/types.py
index e01f451e..828ab20b 100644
--- a/coverage/types.py
+++ b/coverage/types.py
@@ -29,7 +29,11 @@ else:
## 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]]