Sorry, something went wrong.
|
This broke a couple of the asyncio tests, I'm checking why. |
Sorry, something went wrong.
|
This broke a couple of the asyncio tests, I'm checking why. Right, because I removed the traceback update, which is not part of the normalising. The tests pass if I put it back. But I think the right place to do this is when the exception is captured, here cpython/Modules/_asynciomodule.c Line 2705 in cb8f491 |
Sorry, something went wrong.
| if (tb2 != NULL) { | ||
| PyException_SetTraceback(val2, tb2); | ||
| } | ||
|
|
There was a problem hiding this comment.
Is this deletion supposed to be part of this PR? (The PR title didn't indicate a cleanup in errors.c.)
@1st1 should probably review this.
Sorry, something went wrong.
There was a problem hiding this comment.
It is intended, I thought the error.c change doesn’t need to be in news because it’s a private function.
Yes, I’ll wait to hear from @1st1.
Once we have just exc_value in StackItem, I think we should add something like a PyErr_FetchNormalized(&exc) for these cases. Then you use PyErr_Fetch only for Fetch-Restore.
Sorry, something went wrong.
There was a problem hiding this comment.
Actually it's a good point, I'll remove this from this PR so it's just asyncio and @1st1 won't need to worry about this part.
Sorry, something went wrong.
There was a problem hiding this comment.
LG from me, not sure how long to wait for @1st1.
Sorry, something went wrong.
The handled exception exc_info (unlike the in-flight exception currexc) is always normalized. Except in asyncio, where unnormalised exceptions are saved in a StackItem and need to be normalized when they are used.
This PR brings asyncio in line with the rest of the code, by normalising exceptions and setting the traceback when they are Fetched.
https://bugs.python.org/issue45711