code: stop storing weakref to ExceptionInfo on Traceback and TracebackEntry
TracebackEntry needs the excinfo for the `__tracebackhide__ = callback` functionality, where `callback` accepts the excinfo. Currently it achieves this by storing a weakref to the excinfo which created it. I think this is not great, mixing layers and bloating the objects. Instead, have `ishidden` (and transitively, `Traceback.filter()`) take the excinfo as a parameter.
This commit is contained in:
@@ -1814,7 +1814,7 @@ class Function(PyobjMixin, nodes.Item):
|
||||
if not ntraceback:
|
||||
ntraceback = traceback
|
||||
|
||||
excinfo.traceback = ntraceback.filter()
|
||||
excinfo.traceback = ntraceback.filter(excinfo)
|
||||
# issue364: mark all but first and last frames to
|
||||
# only show a single-line message for each frame.
|
||||
if self.config.getoption("tbstyle", "auto") == "auto":
|
||||
|
||||
Reference in New Issue
Block a user