Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-94597: deprecate asyncio.set_event_loop_policy #110728

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

Closed
Closed
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
Next Next commit
deprecate asyncio.set_event_loop_policy
  • Loading branch information
graingert committed Oct 11, 2023
commit a1fa65776c3f0cefc9a67a0463251029a2deb6bf
4 changes: 4 additions & 0 deletions 4 Lib/asyncio/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import subprocess
import sys
import threading
import warnings

from . import format_helpers

Expand Down Expand Up @@ -787,6 +788,9 @@ def set_event_loop_policy(policy):
"""Set the current event loop policy.

If policy is None, the default policy is restored."""
warnings._deprecated("set_event_loop_policy",
"{name!r} is deprecated as of Python 3.13 and will be "
"removed in Python {remove}.", remove=(3, 15))
graingert marked this conversation as resolved.
Show resolved Hide resolved
global _event_loop_policy
if policy is not None and not isinstance(policy, AbstractEventLoopPolicy):
raise TypeError(f"policy must be an instance of AbstractEventLoopPolicy or None, not '{type(policy).__name__}'")
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.