Martin Panter added the comment:

Regarding the second bug, did you consider that the exception thrown to the 
generator can already have __context__ set?

try:
    try: raise ValueError("Context outside of generator")
    except ValueError as ex: raise SubError() from ex
except SubError as ex:
    coro.throw(ex)  # ex.__context__ is a ValueError

I guess either one context could trump the other, or we could to follow the 
chain of contexts and append the other chain at the end. Both these ideas seem 
a bit ugly though.

----------
nosy: +martin.panter

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

Reply via email to