Forward exception information to resources registered in a context#3058
Conversation
|
I am not entirely sure what test is failing. |
|
Failing test seems unrelated. Change looks good. I'm not entirely certain whether this makes more sense as a bug fix (exit wasn't capturing exception) vs feature (exit now captures exception). It's technically a change in behavior, but the old behavior was incomplete. I think it's fine to target it at stable, just wanted to point out it's borderline. |
Ah, yes, this is something I was thinking about as well. The issue was marked as bug, but it's partly a bug, party a "new feature"? |
|
@Jazzinghen I moved it to main so I can merge it and have it go out with 8.3.0. There were a lot of changes made to main that are not on stable. Can you check that changes still look right. |
I'll rebase it and check it in an hour! |
5c3def5 to
7c7ec36
Compare
|
Ok, I rebased the branch against |
|
Also just caught it. Please add to changes.rst. |
Done! |
|
Yes! |
Updated
Context.closeandContext.__exit__to allow forwarding exceptions to the__exit__methods of the resources registered usingContext.with_resource.Added an extra function to handle both
Context.closeandContext.__exit__, calledContext._close_with_exception_infothat accepts all the parameters that__exit__and moved theContent.closelogic there.Added relevant tests.