This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients chris.jerdonek, gvanrossum, hynek, martin.panter, ned.deily, njs, vstinner, yselivanov
Date 2020-05-11.07:53:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589183594.51.0.176955340896.issue29587@roundup.psfhosted.org>
In-reply-to
Content
Would someone be able to approve / take a look at this small PR addressing another aspect of this issue?
https://github.com/python/cpython/pull/19858
I'm hoping it can be part of 3.9, and the deadline is just a week away.

It builds on the already merged PR to address an "Example 3" of this issue (the "yield from" case as opposed to the "yield" case, which the merged PR addressed):

Example 3:

def f():
    yield

def g():
    try:
        raise KeyError('a')
    except Exception:
        yield from f()

gen = g()
gen.send(None)
gen.throw(ValueError)

----------------------
Output without PR:

Traceback (most recent call last):
  File "/.../test-example3.py", line 12, in <module>
    gen.throw(ValueError)
  File "/.../test-example3.py", line 8, in g
    yield from f()
  File "/.../test-example3.py", line 2, in f
    yield
ValueError

----------------------
Output with PR:

Traceback (most recent call last):
  File "/.../test-example3.py", line 6, in g
    raise KeyError('a')
KeyError: 'a'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../test-example3.py", line 12, in <module>
    gen.throw(ValueError)
  File "/.../test-example3.py", line 8, in g
    yield from f()
  File "/.../test-example3.py", line 2, in f
    yield
ValueError
History
Date User Action Args
2020-05-11 07:53:14chris.jerdoneksetrecipients: + chris.jerdonek, gvanrossum, vstinner, ned.deily, njs, hynek, martin.panter, yselivanov
2020-05-11 07:53:14chris.jerdoneksetmessageid: <1589183594.51.0.176955340896.issue29587@roundup.psfhosted.org>
2020-05-11 07:53:14chris.jerdoneklinkissue29587 messages
2020-05-11 07:53:13chris.jerdonekcreate