[Python-Dev] new import hooks & zip import

Just van Rossum just@letterror.com
Thu, 12 Dec 2002 20:25:13 +0100


[Paul Moore]
> > Actually, I'd say that "I can't handle this" should *always* be
> > signalled by an exception (Only One Way To Do It), but rather than
> > reusing ImportError, that should be a new exception type (I don't
> > know what to call it though - ImportHandlerError?) That way, you
> > don't risk masking real exceptions.

[GvR]
> OK, point taken.

If we should add a new exception, would it be ok for it to live in the imp
module? It would be a fairly specialized exception so it's kindof a shame to
pollute the builtin namespace for it.

ImportHookError?

zipimporter currently raises ZipImportError in this case, but that's a subclass
of ImportError... (I'm actually -0 on adding a new exception; I don't think
reusing ImportError is all that bad.)

Just