Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29587>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to