From 34c3647b7e90cddbb6ae5eb51835e8d153ad4343 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sat, 10 Sep 2016 08:24:58 +0300 Subject: [PATCH] Drop last mentions of with ClientSession() --- docs/faq.rst | 2 +- examples/curl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 706c27912b9..07ebdec42f6 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -203,7 +203,7 @@ If your system has several IP interfaces you may choose one which will be used used to bind socket locally:: conn = aiohttp.TCPConnector(local_addr=('127.0.0.1, 0), loop=loop) - with aiohttp.ClientSession(connector=conn) as session: + async with aiohttp.ClientSession(connector=conn) as session: ... .. seealso:: :class:`aiohttp.TCPConnector` and ``local_addr`` parameter. diff --git a/examples/curl.py b/examples/curl.py index 8cbb94f33d5..bf95cdf379b 100755 --- a/examples/curl.py +++ b/examples/curl.py @@ -15,7 +15,7 @@ def curl(url): print('Downloaded: %s' % len(chunk)) response.close() - session.close() + yield from session.close() if __name__ == '__main__':