Skip to content

Commit 40f6e2a

Browse files
Apply suggestions from code review
Co-authored-by: Daniël van Noord <[email protected]>
1 parent 6869f16 commit 40f6e2a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- `PEP 3132 <https://www.python.org/dev/peps/pep-3132/>`_
1+
- `PEP 3132 <https://peps.python.org/pep-3132/>`_

pylint/checkers/exceptions.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ def _is_raising(body: list) -> bool:
133133
"W0707": (
134134
"Consider explicitly re-raising using 'raise NewError(...) from old_error'",
135135
"raise-missing-from",
136-
"Python 3's exception chaining means it shows the traceback of the "
136+
"Python's exception chaining shows the traceback of the "
137+
"current exception, but also of the original exception. When you raise a "
138+
"new exception after another exception was caught it's likely that the "
139+
"second exception is a friendly re-wrapping of the first exception. In such "
140+
"cases `raise from` provides a better link between the two tracebacks in the final error."
137141
"current exception, but also the original exception. Not using `raise "
138142
"from` makes the traceback inaccurate, because the message implies "
139143
"there is a bug in the exception-handling code itself, which is a "

0 commit comments

Comments
 (0)