bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654)

This commit is contained in:
Lisa Roach 2020-10-26 09:28:17 -07:00 committed by GitHub
parent 47e1afd2a1
commit 8374d2ee15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 2 deletions

View file

@ -102,9 +102,9 @@ class IsolatedAsyncioTestCase(TestCase):
ret = await awaitable
if not fut.cancelled():
fut.set_result(ret)
except asyncio.CancelledError:
except (SystemExit, KeyboardInterrupt):
raise
except Exception as ex:
except (BaseException, asyncio.CancelledError) as ex:
if not fut.cancelled():
fut.set_exception(ex)