From e9233fb3d7b10f695091df390cdf6c38dab1fd12 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 Dec 2024 13:21:54 +0100 Subject: [PATCH 1/2] Document that sys.tracebacklimit can be set to None Add `versionchanged` marker Closes: #127555 --- Doc/library/sys.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index dd6293c722e7ad..d3f1c8e125c11a 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1968,8 +1968,11 @@ always available. When this variable is set to an integer value, it determines the maximum number of levels of traceback information printed when an unhandled exception occurs. The default is ``1000``. When set to ``0`` or less, all traceback information - is suppressed and only the exception type and value are printed. + is suppressed and only the exception type and value are printed. Setting it + to ``None`` resets the limit to the default value. + .. versionchanged:: 3.6.4 + Can now be set to ``0`` or ``None``. .. function:: unraisablehook(unraisable, /) From 5ef94fbf6e64e78420e1fecb090d46e984737405 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 5 Dec 2024 13:16:16 +0100 Subject: [PATCH 2/2] Use wording from NEWS file for versionchanged --- Doc/library/sys.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index d3f1c8e125c11a..f58d8cd996a8fc 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -1972,7 +1972,8 @@ always available. to ``None`` resets the limit to the default value. .. versionchanged:: 3.6.4 - Can now be set to ``0`` or ``None``. + Setting to ``0`` or less now suppresses printing tracebacks. + Setting to ``None`` now causes using the default limit. .. function:: unraisablehook(unraisable, /)