mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.10] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#100059)
It no longer emits a deprecation warning if the current event loop was set.
(cherry picked from commit 3fae04b10e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
b7ae1d2285
commit
300d812fd1
13 changed files with 115 additions and 136 deletions
|
|
@ -2319,7 +2319,8 @@ class UnawaitedWarningDuringShutdownTest(unittest.TestCase):
|
|||
def test_unawaited_warning_during_shutdown(self):
|
||||
code = ("import asyncio\n"
|
||||
"async def f(): pass\n"
|
||||
"asyncio.gather(f())\n")
|
||||
"async def t(): asyncio.gather(f())\n"
|
||||
"asyncio.run(t())\n")
|
||||
assert_python_ok("-c", code)
|
||||
|
||||
code = ("import sys\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue