Skip to content

gh-121651: Fix pdb header test #121724

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

Merged
merged 2 commits into from
Jul 13, 2024

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Jul 13, 2024

In the header test for pdb.set_trace, we redirected stdout to a string buffer, but that would only work when we create the Pdb instance after the patch. Due to the changes in #121451 , that's not always guaranteed. So for this test, we clear the Pdb._last_pdb_instance before pdb.set_trace(), which enforces pdb.set_trace() to create a new Pdb instance which has the redirected stdout.

@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting core review labels Jul 13, 2024
@gaogaotiantian gaogaotiantian added skip news and removed tests Tests in the Lib/test dir awaiting core review labels Jul 13, 2024
@gaogaotiantian
Copy link
Member Author

@Eclips4 feel free to take a look at this fix and confirm this works. I tried it locally and ./python -m test test_pdb --forever worked fine.

Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

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

@Eclips4 feel free to take a look at this fix and confirm this works. I tried it locally and ./python -m test test_pdb --forever worked fine.

Yes, I can confirm that this fixes the problem. Thanks!

@gaogaotiantian gaogaotiantian merged commit c0af6d4 into python:main Jul 13, 2024
37 checks passed
@gaogaotiantian gaogaotiantian deleted the fix-pdb-header-test branch July 13, 2024 18:55
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants