|
7 | 7 | import posixpath |
8 | 8 | import re |
9 | 9 | import warnings |
| 10 | +from collections.abc import Sequence |
10 | 11 | from pathlib import Path, PurePath |
11 | | -from typing import List, Optional, Pattern, Sequence, Tuple |
| 12 | +from re import Pattern |
| 13 | +from typing import Optional |
12 | 14 |
|
13 | 15 | from ._base import AbstractSanitizer, AbstractValidator, BaseFile, BaseValidator |
14 | 16 | from ._common import findall_to_str, is_nt_abspath, to_str, validate_pathtype |
@@ -93,7 +95,7 @@ def sanitize(self, value: PathType, replacement_text: str = "") -> PathType: |
93 | 95 | unicode_filepath = os.path.normpath(unicode_filepath) |
94 | 96 | sanitized_path = unicode_filepath |
95 | 97 |
|
96 | | - sanitized_entries: List[str] = [] |
| 98 | + sanitized_entries: list[str] = [] |
97 | 99 | if drive: |
98 | 100 | sanitized_entries.append(drive) |
99 | 101 | for entry in sanitized_path.replace("\\", "/").split("/"): |
@@ -147,7 +149,7 @@ class FilePathValidator(BaseValidator): |
147 | 149 | _MACOS_RESERVED_FILE_PATHS = ("/", ":") |
148 | 150 |
|
149 | 151 | @property |
150 | | - def reserved_keywords(self) -> Tuple[str, ...]: |
| 152 | + def reserved_keywords(self) -> tuple[str, ...]: |
151 | 153 | common_keywords = super().reserved_keywords |
152 | 154 |
|
153 | 155 | if any([self._is_universal(), self._is_posix(), self._is_macos()]): |
|
0 commit comments