mirror of
https://github.com/python/cpython.git
synced 2025-09-01 22:47:59 +00:00
gh-127949: deprecate asyncio.get_event_loop_policy
(#128053)
This deprecates `asyncio.get_event_loop_policy` and will be removed in Python 3.16.
This commit is contained in:
parent
bad3cdefa8
commit
dbd08fb60d
9 changed files with 40 additions and 26 deletions
|
@ -496,7 +496,7 @@ class TestAsyncExitStack(TestBaseExitStack, unittest.IsolatedAsyncioTestCase):
|
|||
class SyncAsyncExitStack(AsyncExitStack):
|
||||
@staticmethod
|
||||
def run_coroutine(coro):
|
||||
loop = asyncio.get_event_loop_policy().get_event_loop()
|
||||
loop = asyncio.new_event_loop()
|
||||
t = loop.create_task(coro)
|
||||
t.add_done_callback(lambda f: loop.stop())
|
||||
loop.run_forever()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue