Show More
@@ -60,6 +60,16 b' else:' | |||
|
60 | 60 | # Allow the set_trace code to operate outside of an ipython instance, even if |
|
61 | 61 | # it does so with some limitations. The rest of this support is implemented in |
|
62 | 62 | # the Tracer constructor. |
|
63 | ||
|
64 | def make_arrow(pad): | |
|
65 | """generate the leading arrow in front of traceback or debugger""" | |
|
66 | if pad >= 2: | |
|
67 | return '-'*(pad-2) + '> ' | |
|
68 | elif pad == 1: | |
|
69 | return '>' | |
|
70 | return '' | |
|
71 | ||
|
72 | ||
|
63 | 73 | def BdbQuit_excepthook(et, ev, tb, excepthook=None): |
|
64 | 74 | """Exception hook which handles `BdbQuit` exceptions. |
|
65 | 75 | |
@@ -460,21 +470,12 b' class Pdb(OldPdb):' | |||
|
460 | 470 | if arrow: |
|
461 | 471 | # This is the line with the error |
|
462 | 472 | pad = numbers_width - len(str(lineno)) - len(bp_mark) |
|
463 | if pad >= 3: | |
|
464 | marker = '-'*(pad-3) + '-> ' | |
|
465 | elif pad == 2: | |
|
466 | marker = '> ' | |
|
467 | elif pad == 1: | |
|
468 | marker = '>' | |
|
469 | else: | |
|
470 | marker = '' | |
|
471 | num = '%s%s' % (marker, str(lineno)) | |
|
472 | line = tpl_line % (bp_mark_color + bp_mark, num, line) | |
|
473 | num = '%s%s' % (make_arrow(pad), str(lineno)) | |
|
473 | 474 | else: |
|
474 | 475 | num = '%*s' % (numbers_width - len(bp_mark), str(lineno)) |
|
475 | line = tpl_line % (bp_mark_color + bp_mark, num, line) | |
|
476 | 476 | |
|
477 | return line | |
|
477 | return tpl_line % (bp_mark_color + bp_mark, num, line) | |
|
478 | ||
|
478 | 479 | |
|
479 | 480 | def list_command_pydb(self, arg): |
|
480 | 481 | """List command to use if we have a newer pydb installed""" |
@@ -400,15 +400,7 b' def _format_traceback_lines(lnum, index, lines, Colors, lvals=None, scheme=None)' | |||
|
400 | 400 | if i == lnum: |
|
401 | 401 | # This is the line with the error |
|
402 | 402 | pad = numbers_width - len(str(i)) |
|
403 | if pad >= 3: | |
|
404 | marker = '-' * (pad - 3) + '-> ' | |
|
405 | elif pad == 2: | |
|
406 | marker = '> ' | |
|
407 | elif pad == 1: | |
|
408 | marker = '>' | |
|
409 | else: | |
|
410 | marker = '' | |
|
411 | num = marker + str(i) | |
|
403 | num = '%s%s' % (debugger.make_arrow(pad), str(lnum)) | |
|
412 | 404 | line = '%s%s%s %s%s' % (Colors.linenoEm, num, |
|
413 | 405 | Colors.line, line, Colors.Normal) |
|
414 | 406 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now