diff --git a/stdlib/compileall.pyi b/stdlib/compileall.pyi index dd1de3f496e7..4621500eda96 100644 --- a/stdlib/compileall.pyi +++ b/stdlib/compileall.pyi @@ -8,7 +8,7 @@ __all__ = ["compile_dir", "compile_file", "compile_path"] class _SupportsSearch(Protocol): def search(self, string: str) -> Any: ... -if sys.version_info >= (3, 9): +if sys.version_info >= (3, 10): def compile_dir( dir: StrPath, maxlevels: int | None = ..., @@ -21,7 +21,7 @@ if sys.version_info >= (3, 9): workers: int = ..., invalidation_mode: PycInvalidationMode | None = ..., *, - stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved + stripdir: StrPath | None = ..., prependdir: StrPath | None = ..., limit_sl_dest: StrPath | None = ..., hardlink_dupes: bool = ..., @@ -36,7 +36,41 @@ if sys.version_info >= (3, 9): optimize: int = ..., invalidation_mode: PycInvalidationMode | None = ..., *, - stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved + stripdir: StrPath | None = ..., + prependdir: StrPath | None = ..., + limit_sl_dest: StrPath | None = ..., + hardlink_dupes: bool = ..., + ) -> int: ... + +elif sys.version_info >= (3, 9): + def compile_dir( + dir: StrPath, + maxlevels: int | None = ..., + ddir: StrPath | None = ..., + force: bool = ..., + rx: _SupportsSearch | None = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + workers: int = ..., + invalidation_mode: PycInvalidationMode | None = ..., + *, + stripdir: str | None = ..., # https://bugs.python.org/issue40447 + prependdir: StrPath | None = ..., + limit_sl_dest: StrPath | None = ..., + hardlink_dupes: bool = ..., + ) -> int: ... + def compile_file( + fullname: StrPath, + ddir: StrPath | None = ..., + force: bool = ..., + rx: _SupportsSearch | None = ..., + quiet: int = ..., + legacy: bool = ..., + optimize: int = ..., + invalidation_mode: PycInvalidationMode | None = ..., + *, + stripdir: str | None = ..., # https://bugs.python.org/issue40447 prependdir: StrPath | None = ..., limit_sl_dest: StrPath | None = ..., hardlink_dupes: bool = ...,