gh-130145: fix loop.run_forever when loop is already running (#130146)

This commit is contained in:
Kumar Aditya 2025-02-15 15:01:53 +05:30 committed by GitHub
parent a05433f24a
commit a545749b0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 1 deletions

View file

@ -671,8 +671,8 @@ class BaseEventLoop(events.AbstractEventLoop):
def run_forever(self):
"""Run until stop() is called."""
self._run_forever_setup()
try:
self._run_forever_setup()
while True:
self._run_once()
if self._stopping: