https://github.com/python/cpython/commit/dc27218225fc3cfc452c46764e7cb0c1a52792b3
commit: dc27218225fc3cfc452c46764e7cb0c1a52792b3
branch: main
author: FredericDT <git...@fdt.onl>
committer: gaogaotiantian <gaogaotiant...@hotmail.com>
date: 2025-07-24T09:58:54+09:00
summary:

gh-136980: Remove unused C tracing code in bdb (#136981)

files:
A Misc/NEWS.d/next/Library/2025-07-23-11-59-48.gh-issue-136980.BIJzkB.rst
M Doc/library/bdb.rst
M Lib/bdb.py

diff --git a/Doc/library/bdb.rst b/Doc/library/bdb.rst
index 90f042aa377711..c7a3e0c596b9d0 100644
--- a/Doc/library/bdb.rst
+++ b/Doc/library/bdb.rst
@@ -192,12 +192,8 @@ The :mod:`bdb` module also defines two classes:
         entered.
       * ``"return"``: A function or other code block is about to return.
       * ``"exception"``: An exception has occurred.
-      * ``"c_call"``: A C function is about to be called.
-      * ``"c_return"``: A C function has returned.
-      * ``"c_exception"``: A C function has raised an exception.
 
-      For the Python events, specialized functions (see below) are called.  For
-      the C events, no action is taken.
+      For all the events, specialized functions (see below) are called.
 
       The *arg* parameter depends on the previous event.
 
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 4290ef22302a42..efc3e0a235ac8e 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -267,12 +267,9 @@ def trace_dispatch(self, frame, event, arg):
                   is entered.
             return: A function or other code block is about to return.
             exception: An exception has occurred.
-            c_call: A C function is about to be called.
-            c_return: A C function has returned.
-            c_exception: A C function has raised an exception.
 
-        For the Python events, specialized functions (see the dispatch_*()
-        methods) are called.  For the C events, no action is taken.
+        For all the events, specialized functions (see the dispatch_*()
+        methods) are called.
 
         The arg parameter depends on the previous event.
         """
@@ -288,12 +285,6 @@ def trace_dispatch(self, frame, event, arg):
                 return self.dispatch_return(frame, arg)
             if event == 'exception':
                 return self.dispatch_exception(frame, arg)
-            if event == 'c_call':
-                return self.trace_dispatch
-            if event == 'c_exception':
-                return self.trace_dispatch
-            if event == 'c_return':
-                return self.trace_dispatch
             if event == 'opcode':
                 return self.dispatch_opcode(frame, arg)
             print('bdb.Bdb.dispatch: unknown debugging event:', repr(event))
diff --git 
a/Misc/NEWS.d/next/Library/2025-07-23-11-59-48.gh-issue-136980.BIJzkB.rst 
b/Misc/NEWS.d/next/Library/2025-07-23-11-59-48.gh-issue-136980.BIJzkB.rst
new file mode 100644
index 00000000000000..a7111dd2b865ba
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-07-23-11-59-48.gh-issue-136980.BIJzkB.rst
@@ -0,0 +1 @@
+Remove unused C tracing code in bdb for event type ``c_call``, ``c_return`` 
and ``c_exception``

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to