This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients cool-RR, steven.daprano
Date 2021-01-23.12:05:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20210123120349.GC4609@ando.pearwood.info>
In-reply-to <1611385589.59.0.246022540076.issue43002@roundup.psfhosted.org>
Content
How do you "the wrong message" to implicitly chain exceptions rather 
than explicitly?

The difference between:

     try:
         len(1)
     except TypeError as e:
         raise ValueError(msg) from e

and

     try:
         len(1)
     except TypeError as e:
       	 raise ValueError(msg)

is that the first traceback says:

"The above exception was the direct cause of the following exception"

and the second says:

"During handling of the above exception, another exception occurred"

Both messages are correct, but if the difference beween the two matters 
to you, feel free to use whichever form you prefer.
History
Date User Action Args
2021-01-23 12:05:10steven.dapranosetrecipients: + steven.daprano, cool-RR
2021-01-23 12:05:10steven.dapranolinkissue43002 messages
2021-01-23 12:05:10steven.dapranocreate