From dd45026300e6c43c309398ab983abc945f0a994b Mon Sep 17 00:00:00 2001 From: MinRK Date: Fri, 21 Mar 2014 10:59:25 -0700 Subject: [PATCH] add IOLoop.clear_instance like clear_current, but for the global IOLoop instance --- tornado/ioloop.py | 6 ++++++ 1 file changed, 6 insertions(+) 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`. -- 2.47.2