code: update for py313 (#11962)

This commit is contained in:
Shantanu
2024-05-18 13:22:22 -07:00
committed by GitHub
parent 46dc8aac1f
commit bb28ef882f

View File

@@ -1,3 +1,4 @@
import sys
from codeop import CommandCompiler
from collections.abc import Callable, Mapping
from types import CodeType
@@ -18,16 +19,34 @@ class InteractiveInterpreter:
class InteractiveConsole(InteractiveInterpreter):
buffer: list[str] # undocumented
filename: str # undocumented
def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "<console>") -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self, locals: Mapping[str, Any] | None = None, filename: str = "<console>", *, local_exit: bool = False
) -> None: ...
def push(self, line: str, filename: str | None = None) -> bool: ...
else:
def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "<console>") -> None: ...
def push(self, line: str) -> bool: ...
def interact(self, banner: str | None = None, exitmsg: str | None = None) -> None: ...
def push(self, line: str) -> bool: ...
def resetbuffer(self) -> None: ...
def raw_input(self, prompt: str = "") -> str: ...
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
) -> None: ...
if sys.version_info >= (3, 13):
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
local_exit: bool = False,
) -> None: ...
else:
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
) -> None: ...
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...