From: Peter Nelson Date: Tue, 14 Aug 2018 02:42:45 +0000 (-0500) Subject: Fix IOLoop doc example code X-Git-Tag: v6.0.0b1~34^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4a27c06558e1f6e4353a8206a6cb308aecb2f89;p=thirdparty%2Ftornado.git Fix IOLoop doc example code --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 51b5dd1e4..b6efad845 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -67,7 +67,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): @@ -84,7 +84,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)