|
1 | 1 | import sys
|
2 |
| -from _typeshed import SupportsRead |
| 2 | +from _typeshed import StrOrBytesPath, SupportsRead |
3 | 3 | from _typeshed.importlib import LoaderProtocol, MetaPathFinderProtocol, PathEntryFinderProtocol
|
4 | 4 | from collections.abc import Callable, Iterable, Iterator
|
5 | 5 | from typing import IO, Any, NamedTuple, TypeVar
|
@@ -31,21 +31,21 @@ def extend_path(path: _PathT, name: str) -> _PathT: ...
|
31 | 31 |
|
32 | 32 | if sys.version_info < (3, 12):
|
33 | 33 | class ImpImporter:
|
34 |
| - def __init__(self, path: str | None = None) -> None: ... |
| 34 | + def __init__(self, path: StrOrBytesPath | None = None) -> None: ... |
35 | 35 |
|
36 | 36 | class ImpLoader:
|
37 |
| - def __init__(self, fullname: str, file: IO[str], filename: str, etc: tuple[str, str, int]) -> None: ... |
| 37 | + def __init__(self, fullname: str, file: IO[str], filename: StrOrBytesPath, etc: tuple[str, str, int]) -> None: ... |
38 | 38 |
|
39 | 39 | @deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.")
|
40 | 40 | def find_loader(fullname: str) -> LoaderProtocol | None: ...
|
41 |
| -def get_importer(path_item: str) -> PathEntryFinderProtocol | None: ... |
| 41 | +def get_importer(path_item: StrOrBytesPath) -> PathEntryFinderProtocol | None: ... |
42 | 42 | @deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.")
|
43 | 43 | def get_loader(module_or_name: str) -> LoaderProtocol | None: ...
|
44 | 44 | def iter_importers(fullname: str = "") -> Iterator[MetaPathFinderProtocol | PathEntryFinderProtocol]: ...
|
45 |
| -def iter_modules(path: Iterable[str] | None = None, prefix: str = "") -> Iterator[ModuleInfo]: ... |
| 45 | +def iter_modules(path: Iterable[StrOrBytesPath] | None = None, prefix: str = "") -> Iterator[ModuleInfo]: ... |
46 | 46 | def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented
|
47 | 47 | def walk_packages(
|
48 |
| - path: Iterable[str] | None = None, prefix: str = "", onerror: Callable[[str], object] | None = None |
| 48 | + path: Iterable[StrOrBytesPath] | None = None, prefix: str = "", onerror: Callable[[str], object] | None = None |
49 | 49 | ) -> Iterator[ModuleInfo]: ...
|
50 | 50 | def get_data(package: str, resource: str) -> bytes | None: ...
|
51 | 51 |
|
|
0 commit comments