Message288133
The following code prints "KeyError()", which is obviously wrong and rather baffling. Just passing an exception object around *as an object* should not trigger implicit exception chaining!
If you replace the async functions with regular functions then it prints "None", as expected.
Checked on 3.5, 3.6, and more-or-less current master -- bug is present in all 3.
------------
async def f():
return ValueError()
async def g():
try:
raise KeyError
except:
value_error = await f()
print(repr(value_error.__context__))
try:
g().send(None)
except StopIteration:
pass |
|
Date |
User |
Action |
Args |
2017-02-19 13:44:49 | njs | set | recipients:
+ njs |
2017-02-19 13:44:49 | njs | set | messageid: <1487511889.54.0.248268466732.issue29600@psf.upfronthosting.co.za> |
2017-02-19 13:44:49 | njs | link | issue29600 messages |
2017-02-19 13:44:49 | njs | create | |
|