Message290633
> This is a specific example of the general problem reported in issue 25538.
It's a bit different code path/problem. But I agree, we should work on making both `with` and `async with` a bit more usable.
> Would it be possible to change this so it indicates that it was the context that was invalid not an `await` statement?
I'm not sure if we can do anything about this. We compile 'async with' into a set of opcodes. The first ones resolve __aexit__, the latter ones await on it. The one that prepares to await on the aexit (GET_AWAITABLE) is the same that 'await' expression compiles to, and that opcode has no idea what exactly it awaits on.
We could probably add GET_AEXIT_AWAITABLE opcode specifically to improve the error message (other than that it would be a copy of GET_AWAITABLE). I'll think about it. |
|
Date |
User |
Action |
Args |
2017-03-27 17:46:10 | yselivanov | set | recipients:
+ yselivanov, r.david.murray, Tadhg McDonald-Jensen |
2017-03-27 17:46:10 | yselivanov | set | messageid: <1490636770.11.0.708304673176.issue29922@psf.upfronthosting.co.za> |
2017-03-27 17:46:10 | yselivanov | link | issue29922 messages |
2017-03-27 17:46:09 | yselivanov | create | |
|