diff --git a/stdlib/2and3/modulefinder.pyi b/stdlib/2and3/modulefinder.pyi index 4c4962843..a3df358b5 100644 --- a/stdlib/2and3/modulefinder.pyi +++ b/stdlib/2and3/modulefinder.pyi @@ -1,4 +1,4 @@ - +import sys from typing import Optional, Container, Dict, Sequence, Tuple, List, Any, Iterator, IO, Iterable from types import CodeType @@ -29,7 +29,10 @@ class ModuleFinder: excludes: Container[str] # undocumented replace_paths: Sequence[Tuple[str, str]] # undocumented - def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Container[str] = ..., replace_paths: Sequence[Tuple[str, str]] = ...) -> None: ... + if sys.version_info >= (3, 8): + def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Optional[Container[str]] = ..., replace_paths: Optional[Sequence[Tuple[str, str]]] = ...) -> None: ... + else: + def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Container[str] = ..., replace_paths: Sequence[Tuple[str, str]] = ...) -> None: ... def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented def msgin(self, *args: Any) -> None: ... # undocumented def msgout(self, *args: Any) -> None: ... # undocumented @@ -43,7 +46,8 @@ class ModuleFinder: def find_all_submodules(self, m: Module) -> Iterable[str]: ... # undocumented def import_module(self, partname: str, fqname: str, parent: Module) -> Optional[Module]: ... # undocumented def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: Tuple[str, str, str]) -> Module: ... # undocumented - def scan_opcodes(self, co: CodeType) -> Iterator[Tuple[str, Tuple[Any, ...]]]: ... # undocumented + if sys.version_info >= (3, 6): + def scan_opcodes(self, co: CodeType) -> Iterator[Tuple[str, Tuple[Any, ...]]]: ... # undocumented def scan_code(self, co: CodeType, m: Module) -> None: ... # undocumented def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented def add_module(self, fqname: str) -> Module: ... # undocumented diff --git a/tests/stubtest_whitelists/py35.txt b/tests/stubtest_whitelists/py35.txt index cff477e3e..a34230f81 100644 --- a/tests/stubtest_whitelists/py35.txt +++ b/tests/stubtest_whitelists/py35.txt @@ -62,7 +62,6 @@ macpath.split macpath.splitdrive macpath.splitext mmap.ACCESS_DEFAULT -modulefinder.ModuleFinder.scan_opcodes multiprocessing.context.BaseContext.reducer multiprocessing.shared_memory os.DirEntry diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index a427bb570..4701a7506 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -130,7 +130,6 @@ mmap.MADV_NOCORE mmap.MADV_NOSYNC mmap.MADV_PROTECT mmap.MADV_SOFT_OFFLINE -modulefinder.ModuleFinder.__init__ multiprocessing.pool.CLOSE multiprocessing.pool.RUN multiprocessing.pool.TERMINATE