➜

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.

作者 chris.jerdonek
收信人 chris.jerdonek, gvanrossum, hynek, martin.panter, ned.deily, njs, vstinner, yselivanov
日期 2020-05-11.07:53:13
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1589183594.51.0.176955340896.issue29587@roundup.psfhosted.org>
In-reply-to
内容
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
历史
日期 用户 动作 参数
2020-05-11 07:53:14chris.jerdonek修改recipients: + chris.jerdonek, gvanrossum, vstinner, ned.deily, njs, hynek, martin.panter, yselivanov
2020-05-11 07:53:14chris.jerdonek修改messageid: <1589183594.51.0.176955340896.issue29587@roundup.psfhosted.org>
2020-05-11 07:53:14chris.jerdonek链接issue29587 messages
2020-05-11 07:53:13chris.jerdonek创建