[issue25683] __context__ for yields inside except clause

2017-11-30 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker ___ ___

[issue25683] __context__ for yields inside except clause

2017-02-17 Thread Nathaniel Smith
Nathaniel Smith added the comment: 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

[issue25683] __context__ for yields inside except clause

2015-12-17 Thread Yury Selivanov
Yury Selivanov added the comment: I now don't think this is a bug. In the above example, SubError is instantiated outside of `main` generator. It's also thrown *into* `main` from the *outside* scope. And __context__ should be set for exceptions that were originated by the code that was

[issue25683] __context__ for yields inside except clause

2015-11-20 Thread Yury Selivanov
New submission from Yury Selivanov: In the below snippet, SubError will propagate with __context__ set to None, instead of MainError. Maybe this isn't a bug? class MainError(Exception): pass class SubError(Exception): pass def main(): try: raise MainError()