25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | |
def make_excinfo_repr(self, tbstyle): |
if self.excinfo is None: |
return None |
excinfo = self.excinfo |
tb_info = [self.traceback_entry_repr(x, tbstyle) |
for x in excinfo.traceback] |
-> rec_index = excinfo.traceback.recursionindex() |
if hasattr(excinfo, 'type'): |
etype = excinfo.type |
if hasattr(etype, '__name__'): |
etype = etype.__name__ |
else: |
etype = excinfo.typename |
val = getattr(excinfo, 'value', None) |
if not val: |
val = excinfo.exconly() |
val = str(val) |
return (etype, val, (tb_info, rec_index)) | |