@@ -1811,35 +1811,39 @@ always available.
1811
1811
1812
1812
The *unraisable * argument has the following attributes:
1813
1813
1814
- * * exc_type * : Exception type.
1815
- * * exc_value * : Exception value, can be ``None ``.
1816
- * * exc_traceback * : Exception traceback, can be ``None ``.
1817
- * * err_msg * : Error message, can be ``None ``.
1818
- * * object * : Object causing the exception, can be ``None ``.
1814
+ * :attr: ` ! exc_type` : Exception type.
1815
+ * :attr: ` ! exc_value` : Exception value, can be ``None ``.
1816
+ * :attr: ` ! exc_traceback` : Exception traceback, can be ``None ``.
1817
+ * :attr: ` ! err_msg` : Error message, can be ``None ``.
1818
+ * :attr: ` ! object` : Object causing the exception, can be ``None ``.
1819
1819
1820
- The default hook formats * err_msg * and * object * as:
1820
+ The default hook formats :attr: ` ! err_msg` and :attr: ` ! object` as:
1821
1821
``f'{err_msg}: {object!r}' ``; use "Exception ignored in" error message
1822
- if * err_msg * is ``None ``.
1822
+ if :attr: ` ! err_msg` is ``None ``.
1823
1823
1824
1824
:func: `sys.unraisablehook ` can be overridden to control how unraisable
1825
1825
exceptions are handled.
1826
1826
1827
- Storing *exc_value * using a custom hook can create a reference cycle. It
1828
- should be cleared explicitly to break the reference cycle when the
1829
- exception is no longer needed.
1827
+ .. seealso ::
1828
+
1829
+ :func: `excepthook ` which handles uncaught exceptions.
1830
+
1831
+ .. warning ::
1830
1832
1831
- Storing * object * using a custom hook can resurrect it if it is set to an
1832
- object which is being finalized. Avoid storing * object * after the custom
1833
- hook completes to avoid resurrecting objects .
1833
+ Storing :attr: ` !exc_value ` using a custom hook can create a reference cycle.
1834
+ It should be cleared explicitly to break the reference cycle when the
1835
+ exception is no longer needed .
1834
1836
1835
- See also :func: `excepthook ` which handles uncaught exceptions.
1837
+ Storing :attr: `!object ` using a custom hook can resurrect it if it is set to an
1838
+ object which is being finalized. Avoid storing :attr: `!object ` after the custom
1839
+ hook completes to avoid resurrecting objects.
1836
1840
1837
1841
.. audit-event :: sys.unraisablehook hook,unraisable sys.unraisablehook
1838
1842
1839
1843
Raise an auditing event ``sys.unraisablehook `` with arguments
1840
- `` hook ``, `` unraisable `` when an exception that cannot be handled occurs.
1841
- The `` unraisable `` object is the same as what will be passed to the hook.
1842
- If no hook has been set, `` hook `` may be ``None ``.
1844
+ * hook *, * unraisable * when an exception that cannot be handled occurs.
1845
+ The * unraisable * object is the same as what will be passed to the hook.
1846
+ If no hook has been set, * hook * may be ``None ``.
1843
1847
1844
1848
.. versionadded :: 3.8
1845
1849
0 commit comments