Message397230
Over at the Trio project, we have evidence that `AsyncExitStack.enter_async_context(foo())` is not actually equivalent to `async with foo()` regarding raised exception context.
The symptom is a very long, unhelpful tracebacks because the __context__ of raised exceptions is not set to the expected object.
https://github.com/python-trio/trio/issues/2001
I can't speak to this solution myself, but njsmith suggests this amendment to contextlib:
saved_context = exc_details[1].__context__
try:
raise exc_details[1]
finally:
exc_details[1].__context__ = saved_context |
|
Date |
User |
Action |
Args |
2021-07-09 23:59:53 | John Belmonte | set | recipients:
+ John Belmonte, njs |
2021-07-09 23:59:53 | John Belmonte | set | messageid: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> |
2021-07-09 23:59:53 | John Belmonte | link | issue44594 messages |
2021-07-09 23:59:53 | John Belmonte | create | |
|