]> granicus.if.org Git - python/commitdiff
asyncio: add missing @coroutine decorator
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 12 Oct 2014 22:55:50 +0000 (00:55 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 12 Oct 2014 22:55:50 +0000 (00:55 +0200)
Doc/library/asyncio-stream.rst

index 1e6dc9463b327bbef349256bb54356c0eac9d757..348132a5b7b69ba272da24aab892cb23f505e240 100644 (file)
@@ -250,6 +250,7 @@ TCP echo client using the :func:`asyncio.open_connection` function::
 
     import asyncio
 
+    @asyncio.coroutine
     def tcp_echo_client(message, loop):
         reader, writer = yield from asyncio.open_connection('127.0.0.1', 8888,
                                                             loop=loop)
@@ -379,6 +380,7 @@ Coroutine waiting until a socket receives data using the
     except ImportError:
         from asyncio.windows_utils import socketpair
 
+    @asyncio.coroutine
     def wait_for_data(loop):
         # Create a pair of connected sockets
         rsock, wsock = socketpair()