-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-136980: Remove unused C tracing code in bdb #136981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think overall this should be a safe change. trace_dispatch
is the lowest API and there's no (proper) way a subclass can change how it is triggered. (Just thinking about potential backwards compatibility issues).
You do need a news entry here because it's still technically a behavior change.
Doc/library/bdb.rst
Outdated
|
||
For the Python events, specialized functions (see below) are called. For | ||
the C events, no action is taken. | ||
For the Python events, specialized functions (see below) are called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess Python
does not make sense here anymore - it's all the events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I have them in 8bfd968
Lib/bdb.py
Outdated
@@ -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_*() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, we don't need to distinguish Python
events anymore.
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Since bdb was created, it uses
sys.settrace
for tracing.The
c_call
,c_return
, andc_exception
events have historically (since c69ebe8) been dispatched toc_profilefunc
and neverc_tracefunc
. This commit removes the dead code related toc_tracefunc
dispatching.Refers to c69ebe8#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59deR3426-R3461
📚 Documentation preview 📚: https://cpython-previews--136981.org.readthedocs.build/