Closed
Description
Long story short
-
_CoroGuard class has no implementation for
__await__method, only__iter__.
That's why_CoroGuardinstance cannot beawaited, justyielded from. -
Fix warning message for
ClientSession.close()method
Expected behaviour
_CoroGuardcan be awaited
Actual behaviour
_CoroGuardcannot be awaited
Steps to reproduce
#!/usr/bin/env python
import aiohttp
import asyncio
async def coro_function(loop):
session = aiohttp.ClientSession(loop=loop)
await session.close()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(coro_function(loop))
finally:
loop.close()
Your environment
OS X 10.12.3
python 3.6.0
aiohttp==2.2.0