Resolve 3.13 pdb errors (#12267)

This commit is contained in:
Max Muoto
2024-07-09 15:15:37 -05:00
committed by GitHub
parent 23fd30f563
commit 4b9eadad77
2 changed files with 26 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ from cmd import Cmd
from collections.abc import Callable, Iterable, Mapping, Sequence
from inspect import _SourceObjectType
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, ClassVar, TypeVar
from typing import IO, Any, ClassVar, Final, TypeVar
from typing_extensions import ParamSpec, Self
__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"]
@@ -30,6 +30,9 @@ class Pdb(Bdb, Cmd):
commands_resuming: ClassVar[list[str]]
if sys.version_info >= (3, 13):
MAX_CHAINED_EXCEPTION_DEPTH: Final = 999
aliases: dict[str, str]
mainpyfile: str
_wait_for_mainpyfile: bool
@@ -58,8 +61,16 @@ class Pdb(Bdb, Cmd):
if sys.version_info < (3, 11):
def execRcLines(self) -> None: ...
if sys.version_info >= (3, 13):
user_opcode = Bdb.user_line
def bp_commands(self, frame: FrameType) -> bool: ...
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ...
if sys.version_info >= (3, 13):
def interaction(self, frame: FrameType | None, tb_or_exc: TracebackType | BaseException | None) -> None: ...
else:
def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ...
def displayhook(self, obj: object) -> None: ...
def handle_command_def(self, line: str) -> bool: ...
def defaultFile(self) -> str: ...
@@ -72,6 +83,9 @@ class Pdb(Bdb, Cmd):
if sys.version_info < (3, 11):
def _runscript(self, filename: str) -> None: ...
if sys.version_info >= (3, 13):
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override]
def do_commands(self, arg: str) -> bool | None: ...
def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ...
def do_tbreak(self, arg: str) -> bool | None: ...
@@ -81,6 +95,9 @@ class Pdb(Bdb, Cmd):
def do_ignore(self, arg: str) -> bool | None: ...
def do_clear(self, arg: str) -> bool | None: ...
def do_where(self, arg: str) -> bool | None: ...
if sys.version_info >= (3, 13):
def do_exceptions(self, arg: str) -> bool | None: ...
def do_up(self, arg: str) -> bool | None: ...
def do_down(self, arg: str) -> bool | None: ...
def do_until(self, arg: str) -> bool | None: ...
@@ -125,8 +142,14 @@ class Pdb(Bdb, Cmd):
def help_exec(self) -> None: ...
def help_pdb(self) -> None: ...
def sigint_handler(self, signum: signal.Signals, frame: FrameType) -> None: ...
def message(self, msg: str) -> None: ...
if sys.version_info >= (3, 13):
def message(self, msg: str, end: str = "\n") -> None: ...
else:
def message(self, msg: str) -> None: ...
def error(self, msg: str) -> None: ...
if sys.version_info >= (3, 13):
def completenames(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override]
if sys.version_info >= (3, 12):
def set_convenience_variable(self, frame: FrameType, name: str, value: Any) -> None: ...