From: Peter Nelson Date: Tue, 14 Aug 2018 02:42:45 +0000 (-0500) Subject: Fix IOLoop doc example code X-Git-Tag: v5.1.1~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05a5efb45c249e6d5fbd623d61642820c5d09cf6;p=thirdparty%2Ftornado.git Fix IOLoop doc example code --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index f7ee6dd60..8e89c2e35 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -101,7 +101,7 @@ class IOLoop(Configurable): import socket import tornado.ioloop - from tornado import gen + from tornado.gen import convert_yielded from tornado.iostream import IOStream async def handle_connection(connection, address): @@ -118,7 +118,8 @@ class IOLoop(Configurable): raise return connection.setblocking(0) - handle_connection(connection, address) + coro = handle_connection(connection, address) + convert_yielded(coro) if __name__ == '__main__': sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)