Skip to content

Commit 1aa4978

Browse files
committed
Update compileall stripdir type
See python/cpython#19883
1 parent 0220577 commit 1aa4978

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

stdlib/compileall.pyi

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ __all__ = ["compile_dir", "compile_file", "compile_path"]
88
class _SupportsSearch(Protocol):
99
def search(self, string: str) -> Any: ...
1010

11-
if sys.version_info >= (3, 9):
11+
12+
if sys.version_info >= (3, 10):
1213
def compile_dir(
1314
dir: StrPath,
1415
maxlevels: int | None = ...,
@@ -21,7 +22,41 @@ if sys.version_info >= (3, 9):
2122
workers: int = ...,
2223
invalidation_mode: PycInvalidationMode | None = ...,
2324
*,
24-
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
25+
stripdir: StrPath | None = ...,
26+
prependdir: StrPath | None = ...,
27+
limit_sl_dest: StrPath | None = ...,
28+
hardlink_dupes: bool = ...,
29+
) -> int: ...
30+
def compile_file(
31+
fullname: StrPath,
32+
ddir: StrPath | None = ...,
33+
force: bool = ...,
34+
rx: _SupportsSearch | None = ...,
35+
quiet: int = ...,
36+
legacy: bool = ...,
37+
optimize: int = ...,
38+
invalidation_mode: PycInvalidationMode | None = ...,
39+
*,
40+
stripdir: StrPath | None = ...,
41+
prependdir: StrPath | None = ...,
42+
limit_sl_dest: StrPath | None = ...,
43+
hardlink_dupes: bool = ...,
44+
) -> int: ...
45+
46+
elif sys.version_info >= (3, 9):
47+
def compile_dir(
48+
dir: StrPath,
49+
maxlevels: int | None = ...,
50+
ddir: StrPath | None = ...,
51+
force: bool = ...,
52+
rx: _SupportsSearch | None = ...,
53+
quiet: int = ...,
54+
legacy: bool = ...,
55+
optimize: int = ...,
56+
workers: int = ...,
57+
invalidation_mode: PycInvalidationMode | None = ...,
58+
*,
59+
stripdir: str | None = ..., # https://bugs.python.org/issue40447
2560
prependdir: StrPath | None = ...,
2661
limit_sl_dest: StrPath | None = ...,
2762
hardlink_dupes: bool = ...,

0 commit comments

Comments
 (0)