IPython: fix the traceback test
Currently this test fails on Debian (it displays one frame too much), but works on my Mac and on Arch. It appears that the problem is here (in python/vcsn/__init__.py
):
class vcsnTB(AutoFormattedTB):
def structured_traceback(self, type, value, tb, tb_offset=None,
*args, **kwargs):
# If an offset is given, use it, else use the default
offset = tb_offset if tb_offset else self.tb_offset
ftb = AutoFormattedTB.structured_traceback(self, type, value, tb,
offset, *args, **kwargs)
if _traceback_verbose:
return ftb
else:
length = vcsn_traceback_levels(tb)
# Display the 2 header entries plus `length` entries
# minus the entries that were offset, and the footer entry.
return ftb[:2+length-offset] + ftb[-1:]
If you display the len
of ftb
right before the (last) return you don't get the same length on Debian and on the others (9 and 10). Yet, if you return ftb
anyway (discarding the [...:...]
tricks), you get the expect stack trace (with 7 frames). So it appears that this ftb
is containing things that are not displayed, but that we don't count properly in our procedure
We need to understand that difference, and get rid of it.