mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
[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:
parent
235f5fd2ca
commit
3fae04b10e
13 changed files with 109 additions and 123 deletions
|
@ -1740,7 +1740,8 @@ class PolicyTests(unittest.TestCase):
|
|||
|
||||
def test_child_watcher_replace_mainloop_existing(self):
|
||||
policy = self.create_policy()
|
||||
loop = policy.get_event_loop()
|
||||
loop = policy.new_event_loop()
|
||||
policy.set_event_loop(loop)
|
||||
|
||||
# Explicitly setup SafeChildWatcher,
|
||||
# default ThreadedChildWatcher has no _loop property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue