This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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.
History
Date User Action Args
2021-01-03 01:06:44iritkatrielsetrecipients: + iritkatriel, ezio.melotti, serhiy.storchaka, Ken.Cheung
2021-01-03 01:06:44iritkatrielsetmessageid: <1609636004.29.0.12059357414.issue15106@roundup.psfhosted.org>
2021-01-03 01:06:44iritkatriellinkissue15106 messages
2021-01-03 01:06:43iritkatrielcreate