gh-127555: Document that sys.tracebacklimit can be set to None by srittau · Pull Request #127556 · python/cpython
The only instance is this:
limit = getattr(sys, 'tracebacklimit', None) So,
Noneis supported, but that might be incidental. The following code basically skips over any frame limiting iflimitisNone, although I'm not sure what that means exactly, as I'm not particular familiar with the traceback module.
Can support None, and this is necessary, this's not a incidental. After the getattr(sys, 'tracebacklimit', None) statement is executed, it always returns None, because the tracebacklimit attribute does not exist and it never appears in sys module.
Running Release|x64 interpreter...
Python 3.14.0a0 (heads/master-dirty:ff4e499, Nov 16 2024, 20:59:33) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.tracebacklimit
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
sys.tracebacklimit
AttributeError: module 'sys' has no attribute 'tracebacklimit'
(It's fix appears in another PR of mine.)