[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
Change by Thomas Grainger : -- keywords: +patch pull_requests: +25590 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27024 ___ Python tracker ___

[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
Thomas Grainger added the comment: This is the output: ``` Traceback (most recent call last): File "/home/graingert/projects/close.py", line 5, in foo yield File "/home/graingert/projects/close.py", line 12, in raise StartIrritation __main__.StartIrritation The above exception

[issue44566] StopIteration subclass raised in body of 'with' statement suppressed

2021-07-05 Thread Thomas Grainger
New submission from Thomas Grainger : https://bugs.python.org/issue1462485 import contextlib @contextlib.contextmanager def foo(): yield class StartIrritation(StopIteration): pass with foo(): raise StartIrritation -- messages: 396979 nosy: graingert, ncoghlan,