bpo-4643: Handles failure with getattr exception in cgitb by karlcow · Pull Request #24038 · python/cpython (original) (raw)

Actually this getattr should not raise exceptions at all because it is given a default value.

The docs for __getattr__ say: "This method should either return the (computed) attribute value or raise an AttributeError exception." It is an error for it to raise a different exception, so I think this patch should not be merged.