New submission from Nick Coghlan <ncogh...@gmail.com>:

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

----------
components: Interpreter Core
messages: 129729
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Include module name on ImportError
type: feature request
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to