summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/async_case.py
diff options
context:
space:
mode:
authorLisa Roach <lisaroach14@gmail.com>2020-10-26 16:28:17 (GMT)
committerGitHub <noreply@github.com>2020-10-26 16:28:17 (GMT)
commit8374d2ee1589791be8892b00f4bbf8121dde24bd (patch)
tree79838431ff6234169237c54b44a93357221ec3b5 /Lib/unittest/async_case.py
parent47e1afd2a1793b5818a16c41307a4ce976331649 (diff)
downloadcpython-8374d2ee1589791be8892b00f4bbf8121dde24bd.zip
cpython-8374d2ee1589791be8892b00f4bbf8121dde24bd.tar.gz
cpython-8374d2ee1589791be8892b00f4bbf8121dde24bd.tar.bz2
bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654)
Diffstat (limited to 'Lib/unittest/async_case.py')
-rw-r--r--Lib/unittest/async_case.py4
1 files changed, 2 insertions, 2 deletions
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 @@ 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)