-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-130052: Fix some exceptions on error paths in _testexternalinspection #130053
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
vstinner
merged 10 commits into
python:main
from
sergey-miryanov:gh-130052-test-external-inspection-setexception
Feb 20, 2025
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
23fdc5f
Set exception in read_memory if not supported on the platform
sergey-miryanov 9679c08
Merge branch 'main' into gh-130052-test-external-inspection-setexception
sergey-miryanov 5e15349
Add more exceptions to _testexternalinspection
sergey-miryanov 67072cc
Fix PyErr_Format call
sergey-miryanov b8c800c
Fix small typo
sergey-miryanov 4830892
Merge branch 'main' into gh-130052-test-external-inspection-setexception
sergey-miryanov 8bf3c22
Merge branch 'main' into gh-130052-test-external-inspection-setexception
sergey-miryanov 6dfc0f0
Update Modules/_testexternalinspection.c
sergey-miryanov e9ac75b
Remove redundant check of pid_to_task result
sergey-miryanov 4fde8de
Fit lines to 80 columns
sergey-miryanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would it be posssible to move this code inside pid_to_task()? I'm not convinced that PermissionError is appropriate, I would suggest RuntimeError instead.
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 believe it is redundant here. I will remove this check. But I saw on the internets that
task_for_pid
may return code == 5 (os/kern failure) that we don't check - should we?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.
Oh! I think
PyExc_PermissionError
is just exactly for this. I will move it topid_to_task
.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 kept
PyExc_PermissionError
and removed redundant check. Should I replace PermissionError with RuntimeError?