Message305220
Looking at the docs:
https://docs.python.org/3.6/library/sys.html#sys.exc_info states:
If the current stack frame is not handling an exception, the information is taken from the calling stack frame, or its caller, and so on until a stack frame is found that is handling an exception.
And https://docs.python.org/3/reference/simple_stmts.html#the-raise-statement
If no expressions are present, raise re-raises the last exception that was active in the current scope. If no exception is active in the current scope, a RuntimeError exception is raised indicating that this is an error.
Note that `sys.exc_info()` explicitly mentions scanning the stack, but `raise` just says "active in the current scope". Testing on 3.5 shows that "active in the current scope" does scan the stack (for simple calls at least).
Which means that the newly implemented behaviour is correct.
> Note that removing exc_type, exc_value and exc_traceback from PyThreadState breaks Cython.
Is there a matching Cython issue? |
|
Date |
User |
Action |
Args |
2017-10-30 10:59:57 | Mark.Shannon | set | recipients:
+ Mark.Shannon, brett.cannon, ncoghlan, pitrou, scoder, vstinner, larry, benjamin.peterson, njs, asvetlov, martin.panter, serhiy.storchaka, yselivanov, emptysquare |
2017-10-30 10:59:56 | Mark.Shannon | set | messageid: <1509361196.75.0.213398074469.issue25612@psf.upfronthosting.co.za> |
2017-10-30 10:59:56 | Mark.Shannon | link | issue25612 messages |
2017-10-30 10:59:56 | Mark.Shannon | create | |
|