From 395e55872f74f6dfbef225682016e8d72a4de98c Mon Sep 17 00:00:00 2001 From: Josh Humphries Date: Sun, 3 Sep 2017 18:48:54 +0100 Subject: [PATCH] Correctly clear and create a new ioloop during autoreload (#2137) * 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/autoreload.py b/tornado/autoreload.py index da1b100d7..64204455e 100644 --- a/tornado/autoreload.py +++ b/tornado/autoreload.py @@ -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() -- 2.47.2