mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
bpo-34037: test_asyncio uses shutdown_default_executor() (GH-16284)
This commit is contained in:
parent
b2dd2dd6e9
commit
079931d122
3 changed files with 13 additions and 3 deletions
|
@ -509,9 +509,11 @@ def get_function_source(func):
|
|||
class TestCase(unittest.TestCase):
|
||||
@staticmethod
|
||||
def close_loop(loop):
|
||||
executor = loop._default_executor
|
||||
if executor is not None:
|
||||
executor.shutdown(wait=True)
|
||||
if loop._default_executor is not None:
|
||||
if not loop.is_closed():
|
||||
loop.run_until_complete(loop.shutdown_default_executor())
|
||||
else:
|
||||
loop._default_executor.shutdown(wait=True)
|
||||
loop.close()
|
||||
policy = support.maybe_get_event_loop_policy()
|
||||
if policy is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue