@@ -153,14 +153,11 @@ def format_exception_only(exc, /, value=_sentinel):
153
153
154
154
The return value is a list of strings, each ending in a newline.
155
155
156
- Normally, the list contains a single string; however, for
157
- SyntaxError exceptions, it contains several lines that (when
158
- printed) display detailed information about where the syntax
159
- error occurred.
160
-
161
- The message indicating which exception occurred is always the last
162
- string in the list.
163
-
156
+ The list contains the exception's message, which is
157
+ normally a single string; however, for :exc:`SyntaxError` exceptions, it
158
+ contains several lines that (when printed) display detailed information
159
+ about where the syntax error occurred. Following the message, the list
160
+ contains the exception's ``__notes__``.
164
161
"""
165
162
if value is _sentinel :
166
163
value = exc
@@ -857,13 +854,13 @@ def format_exception_only(self, *, show_group=False, _depth=0):
857
854
858
855
The return value is a generator of strings, each ending in a newline.
859
856
860
- Normally, the generator emits a single string; however, for
861
- SyntaxError exceptions, it emits several lines that (when
862
- printed) display detailed information about where the syntax
863
- error occurred.
864
-
865
- The message indicating which exception occurred is always the last
866
- string in the output .
857
+ Generator yields the exception message.
858
+ For :exc:` SyntaxError` exceptions, it
859
+ also yields (before the exception message)
860
+ several lines that (when printed)
861
+ display detailed information about where the syntax error occurred.
862
+ Following the message, generator also yields
863
+ all the exception's ``__notes__`` .
867
864
"""
868
865
869
866
indent = 3 * _depth * ' '
0 commit comments