➜

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.

作者 serhiy.storchaka
收信人 serhiy.storchaka, vstinner, yselivanov
日期 2016-10-10.19:50:26
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1476129027.52.0.516927582831.issue28410@psf.upfronthosting.co.za>
In-reply-to
内容
Sometimes after catching an exception we need to raise new exception of specific type, but save the information about current exception. In Python the syntax "raise ... from ..." serves this purpose (PEP 3134). But in C the code that implements this is too cumbersome. Proposed patch adds private convenient function that raises an exception and sets previously raised exception as its __context__ and __cause__ attributes. This is a generalized version of gen_chain_runtime_error() from Objects/genobject.c. It could be reused in three other places: Objects/abstract.c, Objects/unicodeobject.c, and Modules/zipimport.c (currently only __context__ is set, but setting __cause__ looks preferable), and in new code for issue28214. Maybe there are other opportunities.
历史
日期 用户 动作 参数
2016-10-10 19:50:27serhiy.storchaka修改recipients: + serhiy.storchaka, vstinner, yselivanov
2016-10-10 19:50:27serhiy.storchaka修改messageid: <1476129027.52.0.516927582831.issue28410@psf.upfronthosting.co.za>
2016-10-10 19:50:27serhiy.storchaka链接issue28410 messages
2016-10-10 19:50:27serhiy.storchaka创建