From: MinRK Date: Fri, 21 Mar 2014 17:59:25 +0000 (-0700) Subject: add IOLoop.clear_instance X-Git-Tag: v4.0.0b1~101^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1019%2Fhead;p=thirdparty%2Ftornado.git add IOLoop.clear_instance like clear_current, but for the global IOLoop instance --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 80496e193..421bf8766 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -157,6 +157,12 @@ class IOLoop(Configurable): assert not IOLoop.initialized() IOLoop._instance = self + @staticmethod + def clear_instance(): + """Clear the global `IOLoop` instance.""" + if hasattr(IOLoop, "_instance"): + del IOLoop._instance + @staticmethod def current(): """Returns the current thread's `IOLoop`.