mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-126353: remove implicit creation of loop from asyncio.get_event_loop
(#126354)
Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.
This commit is contained in:
parent
0d80777981
commit
fe5a6ab7be
8 changed files with 24 additions and 62 deletions
|
@ -1195,8 +1195,7 @@ class TestFork(unittest.IsolatedAsyncioTestCase):
|
|||
if pid == 0:
|
||||
# child
|
||||
try:
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
loop = asyncio.get_event_loop_policy().get_event_loop()
|
||||
loop = asyncio.get_event_loop()
|
||||
os.write(w, b'LOOP:' + str(id(loop)).encode())
|
||||
except RuntimeError:
|
||||
os.write(w, b'NO LOOP')
|
||||
|
@ -1207,8 +1206,7 @@ class TestFork(unittest.IsolatedAsyncioTestCase):
|
|||
else:
|
||||
# parent
|
||||
result = os.read(r, 100)
|
||||
self.assertEqual(result[:5], b'LOOP:', result)
|
||||
self.assertNotEqual(int(result[5:]), id(loop))
|
||||
self.assertEqual(result, b'NO LOOP')
|
||||
wait_process(pid, exitcode=0)
|
||||
|
||||
@hashlib_helper.requires_hashdigest('md5')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue