From c01bd592d62ae6380ee1356f4d9cfca17f238aea Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Thu, 11 Jul 2024 19:07:34 -0500 Subject: [PATCH] Fix 3.13 `bdb` issues (#12324) --- stdlib/@tests/stubtest_allowlists/py313.txt | 3 --- stdlib/bdb.pyi | 11 ++++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 3c4ca8ee0..803e3f9c5 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -37,9 +37,6 @@ asyncio.queues.Queue.shutdown asyncio.queues.QueueShutDown asyncio.queues.__all__ asyncio.streams.StreamWriter.__del__ -bdb.Bdb.dispatch_opcode -bdb.Bdb.set_stepinstr -bdb.Bdb.user_opcode codecs.backslashreplace_errors codecs.ignore_errors codecs.namereplace_errors diff --git a/stdlib/bdb.pyi b/stdlib/bdb.pyi index a72e98672..b73d8dcf4 100644 --- a/stdlib/bdb.pyi +++ b/stdlib/bdb.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import ExcInfo, TraceFunction +from _typeshed import ExcInfo, TraceFunction, Unused from collections.abc import Callable, Iterable, Mapping from types import CodeType, FrameType, TracebackType from typing import IO, Any, Literal, SupportsInt, TypeVar @@ -32,6 +32,9 @@ class Bdb: def dispatch_call(self, frame: FrameType, arg: None) -> TraceFunction: ... def dispatch_return(self, frame: FrameType, arg: Any) -> TraceFunction: ... def dispatch_exception(self, frame: FrameType, arg: ExcInfo) -> TraceFunction: ... + if sys.version_info >= (3, 13): + def dispatch_opcode(self, frame: FrameType, arg: Unused) -> Callable[[FrameType, str, Any], TraceFunction]: ... + def is_skipped_module(self, module_name: str) -> bool: ... def stop_here(self, frame: FrameType) -> bool: ... def break_here(self, frame: FrameType) -> bool: ... @@ -42,7 +45,13 @@ class Bdb: def user_return(self, frame: FrameType, return_value: Any) -> None: ... def user_exception(self, frame: FrameType, exc_info: ExcInfo) -> None: ... def set_until(self, frame: FrameType, lineno: int | None = None) -> None: ... + if sys.version_info >= (3, 13): + def user_opcode(self, frame: FrameType) -> None: ... # undocumented + def set_step(self) -> None: ... + if sys.version_info >= (3, 13): + def set_stepinstr(self) -> None: ... # undocumented + def set_next(self, frame: FrameType) -> None: ... def set_return(self, frame: FrameType) -> None: ... def set_trace(self, frame: FrameType | None = None) -> None: ...