Skip to content

Commit 2a13ba9

Browse files
authored
compileall: update for py39 (#3956)
* compileall: add stripdir, prependdir and limit_sl_dest * compileall: compile_dir's default value is now None * compileall: update for current py39 (as of beta1) Co-authored-by: hauntsaninja <>
1 parent 7ba5971 commit 2a13ba9

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

stdlib/3/compileall.pyi

+39-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ else:
1313

1414
if sys.version_info >= (3, 7):
1515
from py_compile import PycInvalidationMode
16+
17+
if sys.version_info >= (3, 9):
1618
def compile_dir(
1719
dir: _Path,
18-
maxlevels: int = ...,
20+
maxlevels: Optional[int] = ...,
1921
ddir: Optional[_Path] = ...,
2022
force: bool = ...,
2123
rx: Optional[Pattern[Any]] = ...,
@@ -24,6 +26,10 @@ if sys.version_info >= (3, 7):
2426
optimize: int = ...,
2527
workers: int = ...,
2628
invalidation_mode: Optional[PycInvalidationMode] = ...,
29+
*,
30+
stripdir: Optional[str] = ..., # TODO: change to Optional[_Path] once https://bugs.python.org/issue40447 is resolved
31+
prependdir: Optional[_Path] = ...,
32+
limit_sl_dest: Optional[_Path] = ...,
2733
) -> _SuccessType: ...
2834
def compile_file(
2935
fullname: _Path,
@@ -34,11 +40,29 @@ if sys.version_info >= (3, 7):
3440
legacy: bool = ...,
3541
optimize: int = ...,
3642
invalidation_mode: Optional[PycInvalidationMode] = ...,
43+
*,
44+
stripdir: Optional[str] = ..., # TODO: change to Optional[_Path] once https://bugs.python.org/issue40447 is resolved
45+
prependdir: Optional[_Path] = ...,
46+
limit_sl_dest: Optional[_Path] = ...,
3747
) -> _SuccessType: ...
38-
def compile_path(
39-
skip_curdir: bool = ...,
48+
elif sys.version_info >= (3, 7):
49+
def compile_dir(
50+
dir: _Path,
4051
maxlevels: int = ...,
52+
ddir: Optional[_Path] = ...,
4153
force: bool = ...,
54+
rx: Optional[Pattern[Any]] = ...,
55+
quiet: int = ...,
56+
legacy: bool = ...,
57+
optimize: int = ...,
58+
workers: int = ...,
59+
invalidation_mode: Optional[PycInvalidationMode] = ...,
60+
) -> _SuccessType: ...
61+
def compile_file(
62+
fullname: _Path,
63+
ddir: Optional[_Path] = ...,
64+
force: bool = ...,
65+
rx: Optional[Pattern[Any]] = ...,
4266
quiet: int = ...,
4367
legacy: bool = ...,
4468
optimize: int = ...,
@@ -67,6 +91,18 @@ else:
6791
legacy: bool = ...,
6892
optimize: int = ...,
6993
) -> _SuccessType: ...
94+
95+
if sys.version_info >= (3, 7):
96+
def compile_path(
97+
skip_curdir: bool = ...,
98+
maxlevels: int = ...,
99+
force: bool = ...,
100+
quiet: int = ...,
101+
legacy: bool = ...,
102+
optimize: int = ...,
103+
invalidation_mode: Optional[PycInvalidationMode] = ...,
104+
) -> _SuccessType: ...
105+
else:
70106
def compile_path(
71107
skip_curdir: bool = ...,
72108
maxlevels: int = ...,

0 commit comments

Comments
 (0)