Skip to content

Update pkgutil.pyi for Python3.12 #10281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions stdlib/pkgutil.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ __all__ = [
"walk_packages",
"iter_modules",
"get_data",
"ImpImporter",
"ImpLoader",
"read_code",
"extend_path",
"ModuleInfo",
]
if sys.version_info < (3, 12):
__all__ += ["ImpImporter", "ImpLoader"]

_PathT = TypeVar("_PathT", bound=Iterable[str])

Expand All @@ -28,11 +28,12 @@ class ModuleInfo(NamedTuple):

def extend_path(path: _PathT, name: str) -> _PathT: ...

class ImpImporter:
def __init__(self, path: str | None = None) -> None: ...
if sys.version_info < (3, 12):
class ImpImporter:
def __init__(self, path: str | None = None) -> None: ...

class ImpLoader:
def __init__(self, fullname: str, file: IO[str], filename: str, etc: tuple[str, str, int]) -> None: ...
class ImpLoader:
def __init__(self, fullname: str, file: IO[str], filename: str, etc: tuple[str, str, int]) -> None: ...

def find_loader(fullname: str) -> Loader | None: ...
def get_importer(path_item: str) -> PathEntryFinder | None: ...
Expand Down
3 changes: 0 additions & 3 deletions tests/stubtest_allowlists/py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ pathlib.PurePath.__init__
pathlib.PurePath.is_relative_to
pathlib.PurePath.relative_to
pdb.Pdb.set_convenience_variable
pkgutil.ImpImporter
pkgutil.ImpLoader
pkgutil.__all__
poplib.POP3_SSL.__init__
posixpath.__all__
posixpath.isjunction
Expand Down