diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-01-13 07:34:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-13 07:34:55 (GMT) |
commit | 87f9b1d53f12538c579598304105974378677012 (patch) | |
tree | 575f4fb58740339139fc53be03d846ae36cf6c4b /Doc | |
parent | 47b1eb9784bd828a5b6541f37c3e1a4b4eb80729 (diff) | |
download | cpython-87f9b1d53f12538c579598304105974378677012.zip cpython-87f9b1d53f12538c579598304105974378677012.tar.gz cpython-87f9b1d53f12538c579598304105974378677012.tar.bz2 |
[3.10] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() (GH-100412) (GH-100970)
Some deprecation warnings will reappear (in a slightly different form) in 3.12.
Co-authored-by: Guido van Rossum <guido@python.org>.
(cherry picked from commit 1b2459dc64b1c3eea89312ea9bf422f8d7c75bb2)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-eventloop.rst | 16 | ||||
-rw-r--r-- | Doc/library/asyncio-policy.rst | 9 | ||||
-rw-r--r-- | Doc/whatsnew/3.10.rst | 13 |
3 files changed, 13 insertions, 25 deletions
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 7b4c3c7..80440da 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -48,7 +48,7 @@ an event loop: running event loop. If there is no running event loop set, the function will return - the result of ``get_event_loop_policy().get_event_loop()`` call. + the result of the ``get_event_loop_policy().get_event_loop()`` call. Because this function has rather complex behavior (especially when custom event loop policies are in use), using the @@ -59,15 +59,15 @@ an event loop: instead of using these lower level functions to manually create and close an event loop. - .. deprecated:: 3.10 - Deprecation warning is emitted if there is no current event loop. - In Python 3.12 it will be an error. - .. note:: - In Python versions 3.10.0--3.10.8 this function - (and other functions which used it implicitly) emitted a + In Python versions 3.10.0--3.10.8 and 3.11.0 this function + (and other functions which use it implicitly) emitted a :exc:`DeprecationWarning` if there was no running event loop, even if - the current loop was set. + the current loop was set on the policy. + In Python versions 3.10.9, 3.11.1 and 3.12 they emit a + :exc:`DeprecationWarning` if there is no running event loop and no + current loop is set. + In some future Python release this will become an error. .. function:: set_event_loop(loop) diff --git a/Doc/library/asyncio-policy.rst b/Doc/library/asyncio-policy.rst index a4cd5aa..f846f76 100644 --- a/Doc/library/asyncio-policy.rst +++ b/Doc/library/asyncio-policy.rst @@ -112,10 +112,11 @@ asyncio ships with the following built-in policies: On Windows, :class:`ProactorEventLoop` is now used by default. - .. deprecated:: 3.10.9 - :meth:`get_event_loop` now emits a :exc:`DeprecationWarning` if there - is no current event loop set and a new event loop has been implicitly - created. In Python 3.12 it will be an error. + .. note:: + In Python versions 3.10.9, 3.11.1 and 3.12 the :meth:`get_event_loop` + method of the default asyncio policy emits a :exc:`DeprecationWarning` + if there is no running event loop and no current loop is set. + In some future Python release this will become an error. .. class:: WindowsSelectorEventLoopPolicy diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index ab93491..47e38ae 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1706,19 +1706,6 @@ Deprecated scheduled for removal in Python 3.12. (Contributed by Erlend E. Aasland in :issue:`42264`.) -* :func:`asyncio.get_event_loop` now emits a deprecation warning if there is - no running event loop. In the future it will be an alias of - :func:`~asyncio.get_running_loop`. - :mod:`asyncio` functions which implicitly create :class:`~asyncio.Future` - or :class:`~asyncio.Task` objects now emit - a deprecation warning if there is no running event loop and no explicit - *loop* argument is passed: :func:`~asyncio.ensure_future`, - :func:`~asyncio.wrap_future`, :func:`~asyncio.gather`, - :func:`~asyncio.shield`, :func:`~asyncio.as_completed` and constructors of - :class:`~asyncio.Future`, :class:`~asyncio.Task`, - :class:`~asyncio.StreamReader`, :class:`~asyncio.StreamReaderProtocol`. - (Contributed by Serhiy Storchaka in :issue:`39529`.) - * The undocumented built-in function ``sqlite3.enable_shared_cache`` is now deprecated, scheduled for removal in Python 3.12. Its use is strongly discouraged by the SQLite3 documentation. See `the SQLite3 docs |