[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#99949)

It no longer emits a deprecation warning if the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Serhiy Storchaka 2022-12-06 17:15:44 +02:00 committed by GitHub
parent 235f5fd2ca
commit 3fae04b10e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 109 additions and 123 deletions

View file

@ -746,7 +746,7 @@ class BaseEventLoopTests(test_utils.TestCase):
def test_env_var_debug(self):
code = '\n'.join((
'import asyncio',
'loop = asyncio.get_event_loop()',
'loop = asyncio.new_event_loop()',
'print(loop.get_debug())'))
# Test with -E to not fail if the unit test was run with