summaryrefslogtreecommitdiff
path: root/Lib/asyncio/test_utils.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-02-02 18:36:31 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-02-02 18:36:31 +0100
commit5d44c08f1c18583d568283170454bab0c11f8257 (patch)
tree3f8ce7f843bc3589aebdb2cc569f8a55202d3dab /Lib/asyncio/test_utils.py
parent7a66fc22ad62563d0907c2fc91229656acfa0dd6 (diff)
downloadcpython-git-5d44c08f1c18583d568283170454bab0c11f8257.tar.gz
Issue #23353, asyncio: Workaround CPython bug #23353
Don't use yield/yield-from in an except block of a generator. Store the exception and handle it outside the except block.
Diffstat (limited to 'Lib/asyncio/test_utils.py')
-rw-r--r--Lib/asyncio/test_utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py
index 6eedc583db..8cee95b84f 100644
--- a/Lib/asyncio/test_utils.py
+++ b/Lib/asyncio/test_utils.py
@@ -416,6 +416,10 @@ class TestCase(unittest.TestCase):
def tearDown(self):
events.set_event_loop(None)
+ # Detect CPython bug #23353: ensure that yield/yield-from is not used
+ # in an except block of a generator
+ self.assertEqual(sys.exc_info(), (None, None, None))
+
@contextlib.contextmanager
def disable_logger():