]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Undeprecate ioloop make_current and clear_current methods
authorThomas Kluyver <thomas@kluyver.me.uk>
Sun, 29 Jan 2023 13:11:52 +0000 (13:11 +0000)
committerThomas Kluyver <thomas@kluyver.me.uk>
Thu, 9 Feb 2023 08:38:59 +0000 (08:38 +0000)
tornado/ioloop.py
tornado/platform/asyncio.py

index 25609790d52e7333ce8c946ea0cf61c92fba2b4b..8245d34a2a7c3951440fa924472f1b92f3593c14 100644 (file)
@@ -33,7 +33,6 @@ import sys
 import time
 import math
 import random
-import warnings
 from inspect import isawaitable
 
 from tornado.concurrent import (
@@ -123,8 +122,7 @@ class IOLoop(Configurable):
     and instead initialize the `asyncio` event loop and use `IOLoop.current()`.
     In some cases, such as in test frameworks when initializing an `IOLoop`
     to be run in a secondary thread, it may be appropriate to construct
-    an `IOLoop` with ``IOLoop(make_current=False)``. Constructing an `IOLoop`
-    without the ``make_current=False`` argument is deprecated since Tornado 6.2.
+    an `IOLoop` with ``IOLoop(make_current=False)``.
 
     In general, an `IOLoop` cannot survive a fork or be shared across processes
     in any way. When multiple processes are being used, each process should
@@ -144,13 +142,6 @@ class IOLoop(Configurable):
        Uses the `asyncio` event loop by default. The ``IOLoop.configure`` method
        cannot be used on Python 3 except to redundantly specify the `asyncio`
        event loop.
-
-    .. deprecated:: 6.2
-       It is deprecated to create an event loop that is "current" but not
-       running. This means it is deprecated to pass
-       ``make_current=True`` to the ``IOLoop`` constructor, or to create
-       an ``IOLoop`` while no asyncio event loop is running unless
-       ``make_current=False`` is used.
     """
 
     # These constants were originally based on constants from the epoll module.
@@ -293,13 +284,6 @@ class IOLoop(Configurable):
 
         .. versionchanged:: 5.0
            This method also sets the current `asyncio` event loop.
-
-        .. deprecated:: 6.2
-           The concept of an event loop that is "current" without
-           currently running is deprecated in asyncio since Python
-           3.10. All related functionality in Tornado is also
-           deprecated. Instead, start the event loop with `asyncio.run`
-           before interacting with it.
         """
         # The asyncio event loops override this method.
         raise NotImplementedError()
@@ -312,13 +296,7 @@ class IOLoop(Configurable):
 
         .. versionchanged:: 5.0
            This method also clears the current `asyncio` event loop.
-        .. deprecated:: 6.2
         """
-        warnings.warn(
-            "clear_current is deprecated",
-            DeprecationWarning,
-            stacklevel=2,
-        )
         IOLoop._clear_current()
 
     @staticmethod
index a3fbdc37e39deaf63c86dda11fe13f2f5aca33a8..779e339c97fe242bfab13f4679cb1d858bee1f4d 100644 (file)
@@ -328,11 +328,6 @@ class AsyncIOLoop(BaseAsyncIOLoop):
         super().close(all_fds=all_fds)
 
     def make_current(self) -> None:
-        warnings.warn(
-            "make_current is deprecated; start the event loop first",
-            DeprecationWarning,
-            stacklevel=2,
-        )
         if not self.is_current:
             try:
                 self.old_asyncio = asyncio.get_event_loop()