Skip to content

Commit c8965ff

Browse files
committed
Remove unused C tracing code in bdb
The `c_call`, `c_return`, and `c_exception` events have historically (since c69ebe8) been dispatched to `c_profilefunc` and never `c_tracefunc`. This commit removes the dead code related to `c_tracefunc` dispatching.
1 parent 149bddc commit c8965ff

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

Doc/library/bdb.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,8 @@ The :mod:`bdb` module also defines two classes:
192192
entered.
193193
* ``"return"``: A function or other code block is about to return.
194194
* ``"exception"``: An exception has occurred.
195-
* ``"c_call"``: A C function is about to be called.
196-
* ``"c_return"``: A C function has returned.
197-
* ``"c_exception"``: A C function has raised an exception.
198195

199-
For the Python events, specialized functions (see below) are called. For
200-
the C events, no action is taken.
196+
For the Python events, specialized functions (see below) are called.
201197

202198
The *arg* parameter depends on the previous event.
203199

Lib/bdb.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,9 @@ def trace_dispatch(self, frame, event, arg):
267267
is entered.
268268
return: A function or other code block is about to return.
269269
exception: An exception has occurred.
270-
c_call: A C function is about to be called.
271-
c_return: A C function has returned.
272-
c_exception: A C function has raised an exception.
273270
274271
For the Python events, specialized functions (see the dispatch_*()
275-
methods) are called. For the C events, no action is taken.
272+
methods) are called.
276273
277274
The arg parameter depends on the previous event.
278275
"""
@@ -288,12 +285,6 @@ def trace_dispatch(self, frame, event, arg):
288285
return self.dispatch_return(frame, arg)
289286
if event == 'exception':
290287
return self.dispatch_exception(frame, arg)
291-
if event == 'c_call':
292-
return self.trace_dispatch
293-
if event == 'c_exception':
294-
return self.trace_dispatch
295-
if event == 'c_return':
296-
return self.trace_dispatch
297288
if event == 'opcode':
298289
return self.dispatch_opcode(frame, arg)
299290
print('bdb.Bdb.dispatch: unknown debugging event:', repr(event))

0 commit comments

Comments
 (0)