mirror of
https://github.com/python/cpython.git
synced 2025-08-18 15:51:23 +00:00
[3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) (GH-27970)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7dc505b865
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
2cdbd3b8b2
commit
970533e65c
6 changed files with 14 additions and 7 deletions
|
@ -29,10 +29,6 @@ class FunctionalTestCaseMixin:
|
|||
self.loop.set_exception_handler(self.loop_exception_handler)
|
||||
self.__unhandled_exceptions = []
|
||||
|
||||
# Disable `_get_running_loop`.
|
||||
self._old_get_running_loop = asyncio.events._get_running_loop
|
||||
asyncio.events._get_running_loop = lambda: None
|
||||
|
||||
def tearDown(self):
|
||||
try:
|
||||
self.loop.close()
|
||||
|
@ -43,7 +39,6 @@ class FunctionalTestCaseMixin:
|
|||
self.fail('unexpected calls to loop.call_exception_handler()')
|
||||
|
||||
finally:
|
||||
asyncio.events._get_running_loop = self._old_get_running_loop
|
||||
asyncio.set_event_loop(None)
|
||||
self.loop = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue