From 5d44c08f1c18583d568283170454bab0c11f8257 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 2 Feb 2015 18:36:31 +0100 Subject: 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. --- Lib/asyncio/test_utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/asyncio/test_utils.py') 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(): -- cgit v1.2.1