Message192199
OK, I'll revert the changes related to ModuleNotFoundError.
As for adding a 'reason' attribute, I see two sticking points. One is how to set the enum value. There is both the C code issue (specifically so ceval.c and import.c can use the values) as well as importlib's bootstrapping restrictions. I'll have to think about whether there is any reasonable way to make it work.
Second, as you hinted at Guido, is exactly what the acceptable cases may be. I would probably start with any ImportError raised directly by import itself and nothing more. Other things from loaders (e.g. bad magic number, stale bytecode, etc.) could be initially left out. That would mean the following possible values:
* module is not a package
* module not found
* None in sys.modules
But the bootstrapping issues for the enum module is probably going to be the showstopper for this. That suggests either adding not_found or figuring out some way to prevent _not_found from leaking outside of importlib (which I now think I can do somewhat reasonably). |
|
Date |
User |
Action |
Args |
2013-07-02 14:26:57 | brett.cannon | set | recipients:
+ brett.cannon, gvanrossum, barry, theller, pitrou, ezio.melotti, Arfrever, cvrebert, asvetlov, chris.jerdonek, python-dev, eric.snow, serhiy.storchaka, Guido.van.Rossum |
2013-07-02 14:26:57 | brett.cannon | set | messageid: <1372775217.28.0.469727212699.issue15767@psf.upfronthosting.co.za> |
2013-07-02 14:26:57 | brett.cannon | link | issue15767 messages |
2013-07-02 14:26:56 | brett.cannon | create | |
|