Message302774
asyncio.wait_for is coroutine itself, to start executing code, no matter with this PR or not it needs to be awaited/yield from
import asyncio
@asyncio.coroutine
def foo():
print(1)
loop = asyncio.get_event_loop()
fut = asyncio.wait_for(foo(), 0)
print('it is not raised yet')
try:
loop.run_until_complete(fut)
except asyncio.TimeoutError:
print('raised here')
will print
it is not raised yet
raised here |
|
Date |
User |
Action |
Args |
2017-09-22 21:18:46 | hellysmile | set | recipients:
+ hellysmile, asvetlov, yselivanov |
2017-09-22 21:18:46 | hellysmile | set | messageid: <1506115126.78.0.0434822641548.issue31556@psf.upfronthosting.co.za> |
2017-09-22 21:18:46 | hellysmile | link | issue31556 messages |
2017-09-22 21:18:46 | hellysmile | create | |
|