Message287993
| Author |
njs |
| Recipients |
abarry, benjamin.peterson, gvanrossum, njs, vstinner, yselivanov |
| Date |
2017年02月17日.11:55:09 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1487332509.31.0.127120222249.issue25683@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I disagree with the stated reason for closing this, because in general, implicit context chaining doesn't care about where the exception was instantiated, only where it was raised. For example:
-----
err = ValueError()
try:
raise KeyError
except Exception:
raise err
-----
Prints:
-----
Traceback (most recent call last):
File "/tmp/bar.py", line 3, in <module>
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/bar.py", line 5, in <module>
raise err
ValueError
-----
I would expect 'gen.throw(OBJ)' to be equivalent to doing 'raise OBJ' inside the generator, and raise does set __context__. |
|