New submission from Eric Snow:

Some exceptions in importlib are raised from within except blocks, resulting in 
chained tracebacks. [1]  For at least some of these we should consider 
suppressing the exception context.

For example (for [1]):

        try:
            path = parent_module.__path__
        except AttributeError:
            msg = (_ERR_MSG + '; {} is not a package').format(name, parent)
            raise ImportError(msg, name=name) from None

[1] http://hg.python.org/cpython/file/default/Lib/importlib/_bootstrap.py#l2088

----------
messages: 203830
nosy: brett.cannon, eric.snow
priority: low
severity: normal
stage: needs patch
status: open
title: suppress context for some exceptions in importlib?
type: enhancement
versions: Python 3.5

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

Reply via email to