Skip to content
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
@asvetlov

Description

@asvetlov

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions