Skip to content

Commit d803d96

Browse files
donBarbosmingyu.park
authored andcommitted
Update {code,codop}.compile_command in 3.14 (python#14049)
1 parent 1269757 commit d803d96

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ builtins.int.__round__
4343
builtins.memoryview.__class_getitem__
4444
builtins.staticmethod.__annotate__
4545
builtins.staticmethod.__class_getitem__
46-
code.compile_command
47-
codeop.compile_command
4846
compression.gzip.GzipFile.readinto
4947
compression.gzip.GzipFile.readinto
5048
compression.gzip.GzipFile.readinto1

stdlib/code.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from codeop import CommandCompiler
2+
from codeop import CommandCompiler, compile_command as compile_command
33
from collections.abc import Callable
44
from types import CodeType
55
from typing import Any
@@ -52,5 +52,3 @@ else:
5252
local: dict[str, Any] | None = None,
5353
exitmsg: str | None = None,
5454
) -> None: ...
55-
56-
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...

stdlib/codeop.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ from types import CodeType
33

44
__all__ = ["compile_command", "Compile", "CommandCompiler"]
55

6-
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...
6+
if sys.version_info >= (3, 14):
7+
def compile_command(source: str, filename: str = "<input>", symbol: str = "single", flags: int = 0) -> CodeType | None: ...
8+
9+
else:
10+
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...
711

812
class Compile:
913
flags: int

0 commit comments

Comments
 (0)