mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
This commit is contained in:
parent
b0b428510c
commit
0ec34cab9d
10 changed files with 304 additions and 451 deletions
|
@ -546,7 +546,21 @@ class TestCase(unittest.TestCase):
|
|||
|
||||
def setUp(self):
|
||||
self._get_running_loop = events._get_running_loop
|
||||
events._get_running_loop = lambda: None
|
||||
|
||||
def _get_running_loop():
|
||||
frame = sys._getframe(1)
|
||||
|
||||
if frame.f_globals['__name__'] == 'asyncio.mixins':
|
||||
# When we called from LoopBoundedMixin we should
|
||||
# fallback to default implementation of get_running_loop
|
||||
try:
|
||||
return events.get_running_loop()
|
||||
except RuntimeError:
|
||||
return None
|
||||
|
||||
return None
|
||||
|
||||
events._get_running_loop = _get_running_loop
|
||||
self._thread_cleanup = threading_helper.threading_setup()
|
||||
|
||||
def tearDown(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue