Message384248
| Author |
iritkatriel |
| Recipients |
Ken.Cheung, ezio.melotti, iritkatriel, serhiy.storchaka |
| Date |
2021年01月03日.01:06:43 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1609636004.29.0.12059357414.issue15106@roundup.psfhosted.org> |
| In-reply-to |
| Content |
The code is not really cloned - note that PyErr_Restore is operating on tstate->curexc (the exception currently being handled) while PyErr_SetExcInfo is operating on tstate->exc_info (the earliest exception currently on the exception stack).
If there is a bug here, I think it is the silent conversion of traceback to NULL in the case where it is neither NULL nor Py_None. (The case in PyErr_Restore that the comment says should not happen).
Otherwise, the difference is that PyErr_Restore transforms Py_None to NULL for the traceback, and PyErr_SetExcInfo doesn't. That conversion seems neither necessary nor wrong. |
|