From: Thomas Grainger Date: Mon, 25 Apr 2022 13:24:23 +0000 (+0100) Subject: remove unreachable asyncio checks X-Git-Tag: v6.2.0b1~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56fdcc11f89d1f447aceac09e932aa0201a0c0ee;p=thirdparty%2Ftornado.git remove unreachable asyncio checks --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index 47b4804ad..3b95d08e6 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -173,15 +173,14 @@ class IOLoop(Configurable): def configure( cls, impl: "Union[None, str, Type[Configurable]]", **kwargs: Any ) -> None: - if asyncio is not None: - from tornado.platform.asyncio import BaseAsyncIOLoop - - if isinstance(impl, str): - impl = import_object(impl) - if isinstance(impl, type) and not issubclass(impl, BaseAsyncIOLoop): - raise RuntimeError( - "only AsyncIOLoop is allowed when asyncio is available" - ) + from tornado.platform.asyncio import BaseAsyncIOLoop + + if isinstance(impl, str): + impl = import_object(impl) + if isinstance(impl, type) and not issubclass(impl, BaseAsyncIOLoop): + raise RuntimeError( + "only AsyncIOLoop is allowed when asyncio is available" + ) super(IOLoop, cls).configure(impl, **kwargs) @staticmethod @@ -332,8 +331,6 @@ class IOLoop(Configurable): old = IOLoop.current(instance=False) if old is not None: old._clear_current_hook() - if asyncio is None: - IOLoop._current.instance = None def _clear_current_hook(self) -> None: """Instance method called when an IOLoop ceases to be current.