mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
gh-127949: deprecate asyncio.set_event_loop_policy (#128024)
First step towards deprecating the asyncio policy system. This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.
This commit is contained in:
parent
559b0e7013
commit
5892853fb7
46 changed files with 81 additions and 67 deletions
|
|
@ -5352,7 +5352,7 @@ class LogRecordTest(BaseTest):
|
|||
logging.logAsyncioTasks = False
|
||||
runner.run(make_record(self.assertIsNone))
|
||||
finally:
|
||||
asyncio.set_event_loop_policy(None)
|
||||
asyncio._set_event_loop_policy(None)
|
||||
|
||||
@support.requires_working_socket()
|
||||
def test_taskName_without_asyncio_imported(self):
|
||||
|
|
@ -5364,7 +5364,7 @@ class LogRecordTest(BaseTest):
|
|||
logging.logAsyncioTasks = False
|
||||
runner.run(make_record(self.assertIsNone))
|
||||
finally:
|
||||
asyncio.set_event_loop_policy(None)
|
||||
asyncio._set_event_loop_policy(None)
|
||||
|
||||
|
||||
class BasicConfigTest(unittest.TestCase):
|
||||
|
|
@ -5668,7 +5668,7 @@ class BasicConfigTest(unittest.TestCase):
|
|||
data = f.read().strip()
|
||||
self.assertRegex(data, r'Task-\d+ - hello world')
|
||||
finally:
|
||||
asyncio.set_event_loop_policy(None)
|
||||
asyncio._set_event_loop_policy(None)
|
||||
if handler:
|
||||
handler.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue