Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-121468: Support async breakpoint in pdb#132576
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-121468: Support async breakpoint in pdb#132576
Uh oh!
There was an error while loading.Please reload this page.
Conversation
gaogaotiantian commentedApr 21, 2025
Hi@iritkatriel , do you think this needs to be reviewed by asyncio expert? |
iritkatriel commentedApr 21, 2025
Yes, ideally. |
gaogaotiantian commentedApr 22, 2025
@kumaraditya303 I hope I can have this in 3.14 because it's a demanding feature. Could you take a look at it and see if it's a reasonable approach? Thanks! |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Lib/pdb.py Outdated
| ande.msg=="'await' outside function" | ||
| ): | ||
| try: | ||
| self._exec_await(buffer,globals,locals) |
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 this should be run without the exception from line 891 in the context
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 restructured the code as we know whether it is an await code during compile. The nice side effect is that we don't need to execute the code under the exception context.
taegyunkim commentedApr 22, 2025
How about adding these direct links to what you added in the docs |
gaogaotiantian commentedApr 22, 2025
What do you mean? The link is already in whatsnew entry. |
Uh oh!
There was an error while loading.Please reload this page.
gaogaotiantian commentedApr 25, 2025
@iritkatriel do you have any other concerns about this PR? |
auvipy left a comment
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.
looks good
gaogaotiantian commentedApr 29, 2025
Hi@iritkatriel , if you don't have any objections I'll merge this in a day or so :) |
iritkatriel commentedApr 29, 2025
Go for it.@kumaraditya303 has approved. |
caee16f intopython:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
I finally figured out how to support
awaitin pdb without too much hack - we can make the breakpoint itself an awaitable, and everything is simply integrated into the system!This PR introduced a new function
pdb.set_trace_asyncwhich the users shouldawait, and with that function, the users can do theirawaits in th debugger!📚 Documentation preview 📚:https://cpython-previews--132576.org.readthedocs.build/