Repository navigation
add Python::try_attach - #5342
Merged
Merged
Conversation
davidhewitt
force-pushed
the
add-try-attach
branch
from
August 20, 2025 20:40
0dd8498 to
185a069
Compare
davidhewitt
force-pushed
the
add-try-attach
branch
from
August 21, 2025 18:27
185a069 to
cf5720d
Compare
davidhewitt
marked this pull request as ready for review
August 21, 2025 18:27
Icxolu
reviewed
Aug 21, 2025
Icxolu
left a comment
Member
There was a problem hiding this comment.
I wonder whether try_acquire should maybe return a Result instead, such that it is possible to check the failure cause. This would allow us to reuse try_acquire in normal attach (lifting the auto-initialize into attach) and keep individual panic messages.
While we're here, we should add the GC traversal panic to the attach documentation.
Member
Author
|
Good idea, I pushed a commit to make that adjustment and do a bit of general tidying up at the same time. |
Icxolu
approved these changes
Aug 21, 2025
Icxolu
left a comment
Member
There was a problem hiding this comment.
Great, looks good!
Just noticed that we should do a follow up to rename Python::assume_gil_acquired() into Python::assume_attached
Member
Author
|
Ah yes and we should include that in 0.26 too. 👍 |
davidhewitt
enabled auto-merge
August 21, 2025 20:48
Closed
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 22, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Followup to #5317
This adds
Python::try_attach, an alternative toPython::attachwhich avoids attempting to attach to the interpreter when the interpreter is not in a suitable state for doing so.Only last commit is new, will leave in draft until suitable for review.