Skip to content

Commit 91e1048

Browse files
committed
Update the documentation for sys.unraisablehook().
1 parent 7f36267 commit 91e1048

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Doc/library/sys.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,11 +2152,17 @@ always available. Unless explicitly noted otherwise, all variables are read-only
21522152

21532153
The default hook formats :attr:`!err_msg` and :attr:`!object` as:
21542154
``f'{err_msg}: {object!r}'``; use "Exception ignored in" error message
2155-
if :attr:`!err_msg` is ``None``.
2155+
if :attr:`!err_msg` is ``None``. Similar to the :mod:`traceback` module,
2156+
this adds color to exceptions by default. This can be disabled using
2157+
:ref:`environment variables <using-on-controlling-color>`.
21562158

21572159
:func:`sys.unraisablehook` can be overridden to control how unraisable
21582160
exceptions are handled.
21592161

2162+
.. versionchanged:: next
2163+
2164+
Exceptions are now printed with colorful text.
2165+
21602166
.. seealso::
21612167

21622168
:func:`excepthook` which handles uncaught exceptions.

0 commit comments

Comments
 (0)