]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Correctly clear and create a new ioloop during autoreload (#2137)
authorJosh Humphries <jrdhumphries@gmail.com>
Sun, 3 Sep 2017 17:48:54 +0000 (18:48 +0100)
committerBen Darnell <ben@bendarnell.com>
Sun, 3 Sep 2017 17:48:54 +0000 (13:48 -0400)
* Correctly clear and create a new ioloop during autoreload

After the removal of the deprecated io_loop arguments from all functions,
the autoreload module stopped working as the wait function's usage was
missed in the refactor. This resulted in the start function receiving an
IOLoop object as its only argument which it then used as the check_time
argument resulting in errors further down the line when the check_time
is expected to be an int.

* Use the ioloop's add_callback function to start the ioloop on wait

There's no need to stop and clear the loop here, just add start as
a callback and start up the ioloop.

tornado/autoreload.py

index da1b100d7ec8e7bca3043c6120b59df4e215430f..64204455e925e7ba8d910b8bad524a62d2d586f5 100644 (file)
@@ -136,7 +136,7 @@ def wait():
     the command-line interface in `main`)
     """
     io_loop = ioloop.IOLoop()
-    start(io_loop)
+    io_loop.add_callback(start)
     io_loop.start()