mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Don't use yield/yield-from in an except block of a generator. Store the exception and handle it outside the except block.
This commit is contained in:
parent
7a66fc22ad
commit
5d44c08f1c
3 changed files with 23 additions and 4 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue