Show More
@@ -28,11 +28,12 b' http://www.python.org/2.2.3/license.html"""' | |||||
28 | import bdb |
|
28 | import bdb | |
29 | import functools |
|
29 | import functools | |
30 | import inspect |
|
30 | import inspect | |
|
31 | import linecache | |||
31 | import sys |
|
32 | import sys | |
32 | import warnings |
|
33 | import warnings | |
33 |
|
34 | |||
34 | from IPython import get_ipython |
|
35 | from IPython import get_ipython | |
35 |
from IPython.utils import PyColorize |
|
36 | from IPython.utils import PyColorize | |
36 | from IPython.utils import coloransi, py3compat |
|
37 | from IPython.utils import coloransi, py3compat | |
37 | from IPython.core.excolors import exception_colors |
|
38 | from IPython.core.excolors import exception_colors | |
38 | from IPython.testing.skipdoctest import skip_doctest |
|
39 | from IPython.testing.skipdoctest import skip_doctest | |
@@ -407,7 +408,7 b' class Pdb(OldPdb):' | |||||
407 | ret.append(u'%s(%s)%s\n' % (link,lineno,call)) |
|
408 | ret.append(u'%s(%s)%s\n' % (link,lineno,call)) | |
408 |
|
409 | |||
409 | start = lineno - 1 - context//2 |
|
410 | start = lineno - 1 - context//2 | |
410 |
lines = |
|
411 | lines = linecache.getlines(filename) | |
411 | start = min(start, len(lines) - context) |
|
412 | start = min(start, len(lines) - context) | |
412 | start = max(start, 0) |
|
413 | start = max(start, 0) | |
413 | lines = lines[start : start + context] |
|
414 | lines = lines[start : start + context] | |
@@ -466,7 +467,7 b' class Pdb(OldPdb):' | |||||
466 | filename = self._exec_filename |
|
467 | filename = self._exec_filename | |
467 |
|
468 | |||
468 | for lineno in range(first, last+1): |
|
469 | for lineno in range(first, last+1): | |
469 |
line = |
|
470 | line = linecache.getline(filename, lineno) | |
470 | if not line: |
|
471 | if not line: | |
471 | break |
|
472 | break | |
472 |
|
473 |
General Comments 0
You need to be logged in to leave comments.
Login now