[Python-Dev] ImportError message suggestion (original) (raw)

Matt Giuca matt.giuca at gmail.com
Tue Aug 19 19:17:37 CEST 2008


I think this is not the place to be discussing the patch (the tracker is), but while I think of it, I'll just say:

You need to DECREF the fn variable (both PyObject_GetAttrString<http://www.python.org/doc/api/object.html>and PyString_FromString <http://www.python.org/doc/api/stringObjects.html>return new references). If this makes no sense, read up on reference counting (http://docs.python.org/ext/refcounts.html, http://www.python.org/doc/api/countingRefs.html).

.... + PyString_AsString(name),

Also:

Otherwise, looks like it will do the job.

But I haven't tested it, just eyeballed it.

Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20080820/3359b6a0/attachment-0001.htm>



More information about the Python-Dev mailing list