8000 deprecate asyncio.set_event_loop_policy · python/cpython@a1fa657 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1fa657

Browse files
committed
deprecate asyncio.set_even 8000 t_loop_policy
1 parent c523ce0 commit a1fa657

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/asyncio/events.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import subprocess
1919
import sys
2020
import threading
21+
import warnings
2122

2223
from . import format_helpers
2324

@@ -787,6 +788,9 @@ def set_event_loop_policy(policy):
787788
"""Set the current event loop policy.
788789
789790
If policy is None, the default policy is restored."""
791+
warnings._deprecated("set_event_loop_policy",
792+
"{name!r} is deprecated as of Python 3.13 and will be "
793+
"removed in Python {remove}.", remove=(3, 15))
790794
global _event_loop_policy
791795
if policy is not None and not isinstance(policy, AbstractEventLoopPolicy):
792796
raise TypeError(f"policy must be an instance of AbstractEventLoopPolicy or None, not '{type(policy).__name__}'")

0 commit comments

Comments
 (0)
0