mirror of
https://github.com/python/cpython.git
synced 2025-11-07 17:12:03 +00:00
[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:
parent
a9d2f08b57
commit
c29fce05f3
47 changed files with 105 additions and 90 deletions
|
|
@ -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__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue