Message129729
| Author |
ncoghlan |
| Recipients |
ncoghlan |
| Date |
2011年02月28日.22:30:43 |
| SpamBayes Score |
0.0011281201 |
| Marked as misclassified |
No |
| Message-id |
<1298932245.21.0.726100579882.issue11356@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Catching ImportError in order to switch to an alternate implementation can mask real failures in imported modules. Attaching the module name as an attribute would allow this to be handled correctly by doing something like:
try:
import simplejson
except ImportError as err:
if err.module_name != 'simplejson':
raise
<backup plan>
See http://mail.python.org/pipermail/python-ideas/2011-February/009209.html |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年02月28日 22:30:45 | ncoghlan | set | recipients:
+ ncoghlan |
| 2011年02月28日 22:30:45 | ncoghlan | set | messageid: <1298932245.21.0.726100579882.issue11356@psf.upfronthosting.co.za> |
| 2011年02月28日 22:30:43 | ncoghlan | link | issue11356 messages |
| 2011年02月28日 22:30:43 | ncoghlan | create |
|