10000 gh-100160: Restore and deprecate implicit creation of an event loop by serhiy-storchaka · Pull Request #100410 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-100160: Restore and deprecate implicit creation of an event loop #100410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweak the documentation.
  • Loading branch information
serhiy-storchaka committed Jan 12, 2023
commit 1e22c6f1c1c1b64e9432704a786e484982862ede
2 changes: 1 addition & 1 deletion Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ an event loop:

.. deprecated:: 3.12
Deprecation warning is emitted if there is no current event loop.
In some future Python release it will become an error.
In some future Python release this will become an error.

.. function:: set_event_loop(loop)

Expand Down
7 changes: 4 additions & 3 deletions Doc/library/asyncio-policy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ asyncio ships with the following built-in policies:
On Windows, :class:`ProactorEventLoop` is now used by default.

.. deprecated:: 3.12
:meth:`get_event_loop` now emits a :exc:`DeprecationWarning` if there
is no current event loop set and it decides to create one.
In some future Python release it will become an error.
The :meth:`get_event_loop` method of the default asyncio policy now emits
a :exc:`DeprecationWarning` if there is no current event loop set and it
decides to create one.
In some future Python release this will become an error.


.. class:: WindowsSelectorEventLoopPolicy
Expand Down
13 changes: 0 additions & 13 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1711,19 +1711,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
Expand Down
6 changes: 3 additions & 3 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ Deprecated
:exc:`ImportWarning`).
(Contributed by Brett Cannon in :gh:`65961`.)

* The :meth:`~asyncio.DefaultEventLoopPolicy.get_event_loop` of the default
event loop policy now emits a :exc:`DeprecationWarning` if there
* The :meth:`~asyncio.DefaultEventLoopPolicy.get_event_loop` method of the
default event loop policy now emits a :exc:`DeprecationWarning` if there
is no current event loop set and it decides to create one.
(Contributed by Serhiy Storchaka and Łukasz Langa in :gh:`100160`.)
(Contributed by Serhiy Storchaka and Guido van Rossum in :gh:`100160`.)


Pending Removal in Python 3.13
Expand Down
0