[New-bugs-announce] [issue29762] Use "raise from None"

Serhiy Storchaka report at bugs.python.org
Wed Mar 8 16:14:36 EST 2017


New submission from Serhiy Storchaka:

Sometimes after catching some exception the new exception of more appropriate type and with more appropriate message is raised. The initial exception often is not relevant to the final exception, it is raised only due to using EAFP rather than LBYL. It should be excluded from the traceback by using "raise from None". This idiom is often used. Following PR makes it be used in more cases.

----------
components: Library (Lib)
messages: 289258
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use "raise from None"
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29762>
_______________________________________


More information about the New-bugs-announce mailing list