def cut(self, path=None, lineno=None, firstlineno=None): |
""" return a Traceback instance wrapping part of this Traceback |
|
by provding any combination of path, lineno and firstlineno, the |
first frame to start the to-be-returned traceback is determined |
|
this allows cutting the first part of a Traceback instance e.g. |
for formatting reasons (removing some uninteresting bits that deal |
with handling of the exception/traceback) |
""" |
for x in self: |
if ((path is None or x.frame.code.path == path) and |
(lineno is None or x.lineno == lineno) and |
(firstlineno is None or x.frame.code.firstlineno == firstlineno)): |
return Traceback(x._rawentry) |
return self |