[Python-Dev] New Import Hooks PEP, a first draft (and req. for PEP #)

Just van Rossum just@letterror.com
Fri, 20 Dec 2002 15:08:58 +0100


Aahz wrote:

> Hmmmm....  I seem to also recall seeing discussion about the callable
> raising something other than ImportError when it just can't handle a
> path element.  What happened to that idea?  That would allow the hook
> handler to distinguish between "I had an error in handling this path"
> and "I can't handle this path".

I argued that it is unlikely that calling the hook would cause an
import, so raising ImportError should be just fine. I don't recall
getting any opposition for that. It's now specced as "must raise
ImportError". I really think the issue is too minor to warrant a new
exception.

Just