From: Josh Humphries Date: Sun, 3 Sep 2017 17:48:54 +0000 (+0100) Subject: Correctly clear and create a new ioloop during autoreload (#2137) X-Git-Tag: v5.0.0~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=395e55872f74f6dfbef225682016e8d72a4de98c;p=thirdparty%2Ftornado.git 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. --- 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()