This repository was archived by the owner on May 31, 2021. It is now read-only.
This repository was archived by the owner on May 31, 2021. It is now read-only.
aiohttp examples should use async context manager for session creation #9
Closed
Description
E.g. instead of
with aiohttp.ClientSession() as session:
...
Use
async with aiohttp.ClientSession() as session:
...
Also please be consistent: either pass loop everywhere (aiohttp.Timeout(5, loop=loop)
, asyncio.gather(*tasks, loop=loop)
) or don't pass it at all.
For first case calling asyncio.set_event_loop(None)
at very begin of the program effectively checks that loop is passed to any call where it's required.
Metadata
Metadata
Assignees
Labels
No labels