mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-134657: Remove newly added private names from asyncio.__all__ (#134665)
This commit is contained in:
parent
f1dcf3c7bf
commit
797abd1f7f
47 changed files with 105 additions and 90 deletions
|
@ -19,7 +19,7 @@ from test.test_asyncio import utils as test_utils
|
|||
|
||||
|
||||
def tearDownModule():
|
||||
asyncio._set_event_loop_policy(None)
|
||||
asyncio.events._set_event_loop_policy(None)
|
||||
|
||||
|
||||
class UpperProto(asyncio.Protocol):
|
||||
|
@ -330,16 +330,16 @@ class WinPolicyTests(WindowsEventsTestCase):
|
|||
async def main():
|
||||
self.assertIsInstance(asyncio.get_running_loop(), asyncio.SelectorEventLoop)
|
||||
|
||||
old_policy = asyncio._get_event_loop_policy()
|
||||
old_policy = asyncio.events._get_event_loop_policy()
|
||||
try:
|
||||
with self.assertWarnsRegex(
|
||||
DeprecationWarning,
|
||||
"'asyncio.WindowsSelectorEventLoopPolicy' is deprecated",
|
||||
):
|
||||
asyncio._set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
asyncio.events._set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
asyncio.run(main())
|
||||
finally:
|
||||
asyncio._set_event_loop_policy(old_policy)
|
||||
asyncio.events._set_event_loop_policy(old_policy)
|
||||
|
||||
def test_proactor_win_policy(self):
|
||||
async def main():
|
||||
|
@ -347,16 +347,16 @@ class WinPolicyTests(WindowsEventsTestCase):
|
|||
asyncio.get_running_loop(),
|
||||
asyncio.ProactorEventLoop)
|
||||
|
||||
old_policy = asyncio._get_event_loop_policy()
|
||||
old_policy = asyncio.events._get_event_loop_policy()
|
||||
try:
|
||||
with self.assertWarnsRegex(
|
||||
DeprecationWarning,
|
||||
"'asyncio.WindowsProactorEventLoopPolicy' is deprecated",
|
||||
):
|
||||
asyncio._set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
|
||||
asyncio.events._set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
|
||||
asyncio.run(main())
|
||||
finally:
|
||||
asyncio._set_event_loop_policy(old_policy)
|
||||
asyncio.events._set_event_loop_policy(old_policy)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue