]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
remove unreachable asyncio checks
authorThomas Grainger <tagrain@gmail.com>
Mon, 25 Apr 2022 13:24:23 +0000 (14:24 +0100)
committerThomas Grainger <tagrain@gmail.com>
Mon, 25 Apr 2022 13:24:23 +0000 (14:24 +0100)
tornado/ioloop.py

index 47b4804ad29b6d7ad7efc7263abcdbe410fffc02..3b95d08e61170fdc4685766ac33199eb2ecbff49 100644 (file)
@@ -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.