summaryrefslogtreecommitdiff
path: root/coverage/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/types.py')
-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]]