Skip to content

Commit 205e993

Browse files
Fix parameter types for pkgutil functions accepting pathlike arguments (#13642)
1 parent 030e7ad commit 205e993

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/pkgutil.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import SupportsRead
2+
from _typeshed import StrOrBytesPath, SupportsRead
33
from _typeshed.importlib import LoaderProtocol, MetaPathFinderProtocol, PathEntryFinderProtocol
44
from collections.abc import Callable, Iterable, Iterator
55
from typing import IO, Any, NamedTuple, TypeVar
@@ -31,21 +31,21 @@ def extend_path(path: _PathT, name: str) -> _PathT: ...
3131

3232
if sys.version_info < (3, 12):
3333
class ImpImporter:
34-
def __init__(self, path: str | None = None) -> None: ...
34+
def __init__(self, path: StrOrBytesPath | None = None) -> None: ...
3535

3636
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: ...
3838

3939
@deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.")
4040
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: ...
4242
@deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.")
4343
def get_loader(module_or_name: str) -> LoaderProtocol | None: ...
4444
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]: ...
4646
def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented
4747
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
4949
) -> Iterator[ModuleInfo]: ...
5050
def get_data(package: str, resource: str) -> bytes | None: ...
5151

0 commit comments

Comments
 (0)