bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654)
diff --git a/Lib/unittest/async_case.py b/Lib/unittest/async_case.py
index 1bc1312..520213c 100644
--- a/Lib/unittest/async_case.py
+++ b/Lib/unittest/async_case.py
@@ -102,9 +102,9 @@ async def _asyncioLoopRunner(self, fut):
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)