Skip to content

Commit fa204f6

Browse files
authored
Update compileall stripdir type (#9404)
See python/cpython#19883
1 parent 9aa3d99 commit fa204f6

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

stdlib/compileall.pyi

+37-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ __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+
if sys.version_info >= (3, 10):
1212
def compile_dir(
1313
dir: StrPath,
1414
maxlevels: int | None = ...,
@@ -21,7 +21,7 @@ if sys.version_info >= (3, 9):
2121
workers: int = ...,
2222
invalidation_mode: PycInvalidationMode | None = ...,
2323
*,
24-
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
24+
stripdir: StrPath | None = ...,
2525
prependdir: StrPath | None = ...,
2626
limit_sl_dest: StrPath | None = ...,
2727
hardlink_dupes: bool = ...,
@@ -36,7 +36,41 @@ if sys.version_info >= (3, 9):
3636
optimize: int = ...,
3737
invalidation_mode: PycInvalidationMode | None = ...,
3838
*,
39-
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
39+
stripdir: StrPath | None = ...,
40+
prependdir: StrPath | None = ...,
41+
limit_sl_dest: StrPath | None = ...,
42+
hardlink_dupes: bool = ...,
43+
) -> int: ...
44+
45+
elif sys.version_info >= (3, 9):
46+
def compile_dir(
47+
dir: StrPath,
48+
maxlevels: int | None = ...,
49+
ddir: StrPath | None = ...,
50+
force: bool = ...,
51+
rx: _SupportsSearch | None = ...,
52+
quiet: int = ...,
53+
legacy: bool = ...,
54+
optimize: int = ...,
55+
workers: int = ...,
56+
invalidation_mode: PycInvalidationMode | None = ...,
57+
*,
58+
stripdir: str | None = ..., # https://bugs.python.org/issue40447
59+
prependdir: StrPath | None = ...,
60+
limit_sl_dest: StrPath | None = ...,
61+
hardlink_dupes: bool = ...,
62+
) -> int: ...
63+
def compile_file(
64+
fullname: StrPath,
65+
ddir: StrPath | None = ...,
66+
force: bool = ...,
67+
rx: _SupportsSearch | None = ...,
68+
quiet: int = ...,
69+
legacy: bool = ...,
70+
optimize: int = ...,
71+
invalidation_mode: PycInvalidationMode | None = ...,
72+
*,
73+
stripdir: str | None = ..., # https://bugs.python.org/issue40447
4074
prependdir: StrPath | None = ...,
4175
limit_sl_dest: StrPath | None = ...,
4276
hardlink_dupes: bool = ...,

0 commit comments

Comments
 (0)