From 1d72c529664e8cb557ed34a780486d0eecc91723 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Mon, 15 Sep 2025 08:58:15 +0800 Subject: [PATCH 1/2] fix: make the same behavior in asyncio repl breakpoint() quit Signed-off-by: yihong0618 --- Lib/asyncio/__main__.py | 1 + .../Library/2025-09-15-08-57-39.gh-issue-138899.Uh6fvY.rst | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2025-09-15-08-57-39.gh-issue-138899.Uh6fvY.rst diff --git a/Lib/asyncio/__main__.py b/Lib/asyncio/__main__.py index ff3a69d1e17297..73ef8a51da536f 100644 --- a/Lib/asyncio/__main__.py +++ b/Lib/asyncio/__main__.py @@ -113,6 +113,7 @@ def run(self): run_multiline_interactive_console, ) try: + # sys.ps1 = ps1 run_multiline_interactive_console(console) except SystemExit: # expected via the `exit` and `quit` commands diff --git a/Misc/NEWS.d/next/Library/2025-09-15-08-57-39.gh-issue-138899.Uh6fvY.rst b/Misc/NEWS.d/next/Library/2025-09-15-08-57-39.gh-issue-138899.Uh6fvY.rst new file mode 100644 index 00000000000000..5c2b408ee907bb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-09-15-08-57-39.gh-issue-138899.Uh6fvY.rst @@ -0,0 +1,3 @@ +Executing ``quit`` command in :mod:`pdb` will raise :exc:`bdb.BdbQuit` when +:mod:`pdb` is started from an asyncio console using :func:`breakpoint` or +:func:`pdb.set_trace`. From dc73b9dc695132a00a3bc76286e711ba91bd1b9e Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Mon, 15 Sep 2025 09:00:54 +0800 Subject: [PATCH 2/2] fix: forget the commnet change Signed-off-by: yihong0618 --- Lib/asyncio/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/asyncio/__main__.py b/Lib/asyncio/__main__.py index 73ef8a51da536f..12d6f7714ee4f4 100644 --- a/Lib/asyncio/__main__.py +++ b/Lib/asyncio/__main__.py @@ -113,7 +113,7 @@ def run(self): run_multiline_interactive_console, ) try: - # sys.ps1 = ps1 + sys.ps1 = ps1 run_multiline_interactive_console(console) except SystemExit: # expected via the `exit` and `quit` commands