summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-27 06:57:14 (GMT)
committerGitHub <noreply@github.com>2019-05-27 06:57:14 (GMT)
commit71c52e3048dd07567f0c690eab4e5d57be66f534 (patch)
tree7f3a063d2d3edb324d7d00bf13a66ddad689d22e /Doc/library/sys.rst
parent2f0bfd27a5e3a9a7cbeb2ddd45ce50c3d4bdb4e9 (diff)
downloadcpython-71c52e3048dd07567f0c690eab4e5d57be66f534.zip
cpython-71c52e3048dd07567f0c690eab4e5d57be66f534.tar.gz
cpython-71c52e3048dd07567f0c690eab4e5d57be66f534.tar.bz2
bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r--Doc/library/sys.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 0294f74..51a208e 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -1566,11 +1566,16 @@ always available.
* *exc_type*: Exception type.
* *exc_value*: Exception value, can be ``None``.
* *exc_traceback*: Exception traceback, can be ``None``.
+ * *err_msg*: Error message, can be ``None``.
* *object*: Object causing the exception, can be ``None``.
:func:`sys.unraisablehook` can be overridden to control how unraisable
exceptions are handled.
+ The default hook formats *err_msg* and *object* as:
+ ``f'{err_msg}: {object!r}'``; use "Exception ignored in" error message
+ if *err_msg* is ``None``.
+
See also :func:`excepthook` which handles uncaught exceptions.
.. versionadded:: 3.8