homepage

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 eric.snow
Recipients Arfrever, Guido.van.Rossum, asvetlov, barry, brett.cannon, chris.jerdonek, cvrebert, eric.snow, ezio.melotti, gvanrossum, jcea, pitrou, python-dev, serhiy.storchaka, theller
Date 2014年05月26日.04:58:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401080325.02.0.319140236138.issue15767@psf.upfronthosting.co.za>
In-reply-to
Content
Any chance we could revive ModuleNotFoundError? It's nice to be able to distinguish between the failure to *find* the module during import from other uses of ImportError. I'd definitely expect it to work the way Guido explained. Basically only importlib._bootstrap._find_and_load_unlocked() would raise ModuleNotFoundError (when _find_spec() returns None).
I've found the exception to be very useful while working on the importlib backport (https://bitbucket.org/ericsnowcurrently/importlib2). My desire for adding ModuleNotFoundError is unrelated to its internal use in importlib that motivated the original request (see msg182332).
Here's the signature:
 ModuleNotFoundError(*args, name=None), inherits from ImportError
For reference, here's ImportError:
 ImportError(*args, name=None, path=None)
ModuleNotFoundError would need to be exposed somewhere sensible since once people see in tracebacks they'll want to catch it. :) I'd expect that to be either in builtins or as importlib.ModuleNotFoundError. We may be able to get away with not adding it to builtins, but maybe it would still make sense.
History
Date User Action Args
2014年05月26日 04:58:45eric.snowsetrecipients: + eric.snow, gvanrossum, barry, brett.cannon, theller, jcea, pitrou, ezio.melotti, Arfrever, cvrebert, asvetlov, chris.jerdonek, python-dev, serhiy.storchaka, Guido.van.Rossum
2014年05月26日 04:58:45eric.snowsetmessageid: <1401080325.02.0.319140236138.issue15767@psf.upfronthosting.co.za>
2014年05月26日 04:58:45eric.snowlinkissue15767 messages
2014年05月26日 04:58:44eric.snowcreate

AltStyle によって変換されたページ (->オリジナル) /