Irit Katriel <iritkatr...@gmail.com> added the comment:

Lib/logging/config.py has this, which looks like it's partly remnants of old 
exception handling APIs: 

except ImportError:
    e, tb = sys.exc_info()[1:]
    v = ValueError('Cannot resolve %r: %s' % (s, e))
    v.__cause__, v.__traceback__ = e, tb
    raise v

It is clearer if written as:

except ImportError as e:
    v = ValueError('Cannot resolve %r: %s' % (s, e))
    raise v from e


(note that this doesn't copy the traceback from e to v, but this is redundant 
information anyway because e is chained to v as the cause).

----------

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

Reply via email to