mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #28613: Fix get_event_loop() to return the current loop
when called from coroutines or callbacks.
This commit is contained in:
parent
1ea023e523
commit
600a349781
18 changed files with 126 additions and 2 deletions
|
@ -449,7 +449,13 @@ class TestCase(unittest.TestCase):
|
|||
self.set_event_loop(loop)
|
||||
return loop
|
||||
|
||||
def setUp(self):
|
||||
self._get_running_loop = events._get_running_loop
|
||||
events._get_running_loop = lambda: None
|
||||
|
||||
def tearDown(self):
|
||||
events._get_running_loop = self._get_running_loop
|
||||
|
||||
events.set_event_loop(None)
|
||||
|
||||
# Detect CPython bug #23353: ensure that yield/yield-from is not used
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue