mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-127949: deprecate asyncio.set_event_loop
(#128218)
Deprecate `asyncio.set_event_loop` to be removed in Python 3.16.
This commit is contained in:
parent
3ddd70ceaa
commit
9fce906825
16 changed files with 77 additions and 55 deletions
|
@ -178,8 +178,8 @@ class BaseFutureTests:
|
|||
|
||||
def test_constructor_use_global_loop(self):
|
||||
# Deprecated in 3.10, undeprecated in 3.12
|
||||
asyncio.set_event_loop(self.loop)
|
||||
self.addCleanup(asyncio.set_event_loop, None)
|
||||
asyncio._set_event_loop(self.loop)
|
||||
self.addCleanup(asyncio._set_event_loop, None)
|
||||
f = self._new_future()
|
||||
self.assertIs(f._loop, self.loop)
|
||||
self.assertIs(f.get_loop(), self.loop)
|
||||
|
@ -566,8 +566,8 @@ class BaseFutureTests:
|
|||
|
||||
def test_wrap_future_use_global_loop(self):
|
||||
# Deprecated in 3.10, undeprecated in 3.12
|
||||
asyncio.set_event_loop(self.loop)
|
||||
self.addCleanup(asyncio.set_event_loop, None)
|
||||
asyncio._set_event_loop(self.loop)
|
||||
self.addCleanup(asyncio._set_event_loop, None)
|
||||
def run(arg):
|
||||
return (arg, threading.get_ident())
|
||||
ex = concurrent.futures.ThreadPoolExecutor(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue