Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantiangaogaotiantian commentedApr 16, 2025
edited by github-actionsbot
Loading

I finally figured out how to supportawait in 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 functionpdb.set_trace_async which the users shouldawait, and with that function, the users can do theirawaits in th debugger!


📚 Documentation preview 📚:https://cpython-previews--132576.org.readthedocs.build/

Zheaoli, shengbo-ma, and Felix3322 reacted with thumbs up emoji
@bedevere-appbedevere-appbot mentioned this pull requestApr 16, 2025
@gaogaotiantian
Copy link
MemberAuthor

Hi@iritkatriel , do you think this needs to be reviewed by asyncio expert?

@iritkatriel
Copy link
Member

Yes, ideally.

@gaogaotiantian
Copy link
MemberAuthor

@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!

Lib/pdb.py Outdated
and e.msg == "'await' outside function"
):
try:
self._exec_await(buffer, globals, locals)
Copy link
Contributor

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

Copy link
MemberAuthor

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
Copy link

@gaogaotiantian
Copy link
MemberAuthor

What do you mean? The link is already in whatsnew entry.

@gaogaotiantian
Copy link
MemberAuthor

@iritkatriel do you have any other concerns about this PR?

Copy link

@auvipyauvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

looks good

@gaogaotiantian
Copy link
MemberAuthor

Hi@iritkatriel , if you don't have any objections I'll merge this in a day or so :)

@iritkatriel
Copy link
Member

Hi@iritkatriel , if you don't have any objections I'll merge this in a day or so :)

Go for it.@kumaraditya303 has approved.

@gaogaotiantiangaogaotiantian merged commitcaee16f intopython:mainApr 29, 2025
43 checks passed
@gaogaotiantiangaogaotiantian deleted the support-async-breakpoint branchApril 29, 2025 16:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@graingertgraingertgraingert left review comments

@graingert-coefgraingert-coefgraingert-coef left review comments

@auvipyauvipyauvipy approved these changes

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

@iritkatrieliritkatrielAwaiting requested review from iritkatriel

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@gaogaotiantian@iritkatriel@taegyunkim@graingert@auvipy@kumaraditya303@graingert-coef

[8]ページ先頭

©2009-2025 Movatter.jp