Repository navigation
Conversation
Member
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it. Thanks for the report and the clear regression test. This is already fixed in #708, which reworks wrapper teardown so the second-yield error is raised inside the unwind handler, the same fix as here. Your four new test cases fail on main and pass on #708. Closing as a duplicate of #708. Generated by Claude Code |
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.
When a new-style wrapper yields a second time during teardown,
_multicallraises itsRuntimeErroroutside the unwind loop's exception handler. This aborts the loop: outer wrappers never receive the error, and their teardown code can remain suspended until garbage collection. Keeping the exception traceback alive also keeps those generators alive.Move the existing
_raise_wrapfailcall inside the handler'stryblock so the error follows the same path as other teardown failures. The invalid wrapper is still closed immediately, and the existing diagnostic is preserved. Outer wrappers can inspect or handle the failure and complete their teardown before the hook call exits.The regression covers old- and new-style outer wrappers around an invalid new-style wrapper, with both a successful hook and a hook exception. It checks exception identity and cleanup order while retaining the traceback.
Validation on Python 3.13.12:
78e3f45d6c18a6efe6c46a2a79b63073f45a44bdand pass with the fix.uv run pytest: 223 passed.uv run pre-commit run -a: all hooks passed, including mypy.firstresultmodes.AI assistance: AI agents discovered, implemented, and tested this change. A separate AI agent performed an automated review. No human review is claimed.