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 brian.curtin
Recipients Trundle, belopolsky, brett.cannon, brian.curtin, cool-RR, eric.araujo, eric.snow, giampaolo.rodola, gruszczy, loewis, ncoghlan, nedbat, pitrou, r.david.murray, techtonik, vstinner
Date 2012-02-09.18:59:58
SpamBayes Score 4.4665666e-07
Marked as misclassified No
Message-id <1328814000.2.0.314352858465.issue1559549@psf.upfronthosting.co.za>
In-reply-to
Content
Here's an updated patch which creates two convenience functions, PyErr_SetFromImportErrorWithName and PyErr_SetFromImportErrorWithNameAndPath. I figure the two common cases are that you'll want to set just a name or you'll want a name and a path.

*WithName is all that I've applied for now, and I've only done it in import.c to allow Brett to continue with his work. I'll come back and make changes elsewhere in the code, and I'll apply the *WithNameAndPath function where I need it for #10854.

All tests pass and some IRL testing works nicely.

Note: I'm a little rushed at the moment so I have not included docs but I will surely update them. I just want to get Brett what he needs by this afternoon.
History
Date User Action Args
2012-02-09 19:00:00brian.curtinsetrecipients: + brian.curtin, loewis, brett.cannon, ncoghlan, belopolsky, pitrou, vstinner, techtonik, giampaolo.rodola, nedbat, eric.araujo, r.david.murray, Trundle, gruszczy, cool-RR, eric.snow
2012-02-09 19:00:00brian.curtinsetmessageid: <1328814000.2.0.314352858465.issue1559549@psf.upfronthosting.co.za>
2012-02-09 18:59:59brian.curtinlinkissue1559549 messages
2012-02-09 18:59:59brian.curtincreate