[3.14] gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665) (#136455)

gh-134657: Remove newly added private names from asyncio.__all__ (GH-134665)
(cherry picked from commit 797abd1f7f)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-07-09 10:34:19 +02:00 committed by GitHub
parent a9d2f08b57
commit c29fce05f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 105 additions and 90 deletions

View file

@ -19,7 +19,7 @@
def tearDownModule():
asyncio._set_event_loop_policy(None)
asyncio.events._set_event_loop_policy(None)
class UpperProto(asyncio.Protocol):
@ -330,16 +330,16 @@ def test_selector_win_policy(self):
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 @@ async def main():
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__':