Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit dbbe5c4

Browse files
committed
Update README.md
1 parent 0c12076 commit dbbe5c4

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

README

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ response.
77

88
Sniffing (when requested) is also done via a scheduled coroutine.
99

10-
Example for python 3.5+
10+
Example for python 3.6+
1111

1212
.. code-block:: python
1313

@@ -25,22 +25,6 @@ Example for python 3.5+
2525
loop.run_until_complete(client.transport.close())
2626
loop.close()
2727

28-
Example for python 3.4
29-
30-
.. code-block:: python
31-
32-
import asyncio
33-
from elasticsearch_async import AsyncElasticsearch
34-
hosts = ['localhost', 'other-host']
35-
36-
async def print_info():
37-
async with AsyncElasticsearch(hosts=hosts) as client:
38-
print(await client.info())
39-
40-
loop = asyncio.get_event_loop()
41-
loop.run_until_complete(print_info())
42-
loop.close()
43-
4428

4529
Example with SSL Context
4630

@@ -58,9 +42,8 @@ Example with SSL Context
5842
http_auth=('elastic', 'changeme')
5943
)
6044

61-
@asyncio.coroutine
62-
def print_info():
63-
info = yield from client.info()
45+
async def print_info():
46+
info = await client.info()
6447
print(info)
6548

6649
loop = asyncio.get_event_loop()

0 commit comments

Comments
 (0)