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 carljm
Recipients carljm, ncoghlan, serhiy.storchaka
Date 2018-05-19.15:47:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526744842.06.0.682650639539.issue33576@psf.upfronthosting.co.za>
In-reply-to
Content
Awkwardly, the motivating use case in issue21145 is a TypeError that we wanted to raise within __set_name__, and not have replaced. It feels a little ugly to special case TypeError this way. 

I like the _PyErr_TrySetFromCause idea. That function is a bit ugly too, in the way it has to try and sniff out whether an exception has extra state or is safe to copy and add extra context to. But in practice I think the results would be pretty good here. Most of the time you’d get the original exception but with added useful context; occasionally for some exception types you might just not get the extra context. But as long as TypeError falls in the former category it would help with the worst case. 

I’ll look at using that in the PR.
History
Date User Action Args
2018-05-19 15:47:22carljmsetrecipients: + carljm, ncoghlan, serhiy.storchaka
2018-05-19 15:47:22carljmsetmessageid: <1526744842.06.0.682650639539.issue33576@psf.upfronthosting.co.za>
2018-05-19 15:47:22carljmlinkissue33576 messages
2018-05-19 15:47:22carljmcreate