diff --git a/CHANGES/4603.doc b/CHANGES/4603.doc new file mode 100644 index 00000000000..aee06176832 --- /dev/null +++ b/CHANGES/4603.doc @@ -0,0 +1 @@ +Fixed wrong "Usage" docstring of ``aiohttp.client.request``. \ No newline at end of file diff --git a/aiohttp/client.py b/aiohttp/client.py index 61268292d65..36044b5056f 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -1130,10 +1130,10 @@ def request( total timeout by default. Usage:: >>> import aiohttp - >>> resp = await aiohttp.request('GET', 'http://python.org/') - >>> resp - - >>> data = await resp.read() + >>> async with aiohttp.request('GET', 'http://python.org/') as resp: + ... print(resp) + ... data = await resp.read() + """ connector_owner = False if connector is None: