[Python-Dev] cpython: Fix #10854. Make use of the new path and name attributes on ImportError

Antoine Pitrou solipsis at pitrou.net
Mon Apr 16 22:31:18 CEST 2012


Le lundi 16 avril 2012 à 15:27 -0500, Brian Curtin a écrit :
> On Mon, Apr 16, 2012 at 09:54, Brian Curtin <brian at python.org> wrote:
> > On Mon, Apr 16, 2012 at 09:52, Brett Cannon <brett at python.org> wrote:
> >>
> >>
> >> On Mon, Apr 16, 2012 at 07:19, Antoine Pitrou <solipsis at pitrou.net> wrote:
> >>>
> >>> On Mon, 16 Apr 2012 07:10:31 +0200
> >>> brian.curtin <python-checkins at python.org> wrote:
> >>> > PyErr_SetFromImportErrorWithNameAndPath
> >>>
> >>> Apparently this new function isn't documented anywhere.
> >>>
> >>
> >> I forgot to write the docs for it when I committed Brian's code.
> >>
> >> Brian, do you mind writing the docs for the two functions?
> >
> > I'll take care of it today.
> 
> Done. http://hg.python.org/cpython/rev/5cc8b717b38c

It would be nice if the refleak behaviour of these functions was
documented too (or, better, fixed, if I'm reading the code correctly;
reference-stealing functions are generally a nuisance).

By the way, why is the naming so complicated?
PyErr_SetImportError() would have sounded explicit enough :)

Regards

Antoine.




More information about the Python-Dev mailing list