##// END OF EJS Templates
fix for list pdb listcommand, broken for %run -d...
Jörgen Stenarson -
Show More
@@ -441,11 +441,17 b' class Pdb(OldPdb):'
441 441 tpl_line = '%%s%s%%s %s%%s' % (Colors.lineno, ColorsNormal)
442 442 tpl_line_em = '%%s%s%%s %s%%s%s' % (Colors.linenoEm, Colors.line, ColorsNormal)
443 443 src = []
444 lines = linecache.getlines(filename)
444 if filename == "<string>" and hasattr(self, "_exec_filename"):
445 lines = list(open(self._exec_filename))
446 else:
447 lines = linecache.getlines(filename)
445 448 try:
446 449 encoding, _ = openpy.detect_encoding(_readline(lines))
447 450 except SyntaxError:
448 451 encoding = "ascii"
452 if not lines:
453 print >>io.stdout, "No src could be located using filename: %r"%filename
454 return #Bailing out, there is nothing to see here
449 455 for lineno in range(first, last+1):
450 456 line = py3compat.cast_unicode(lines[lineno])
451 457 if not line:
@@ -554,6 +554,8 b' python-profiler package from non-free.""")'
554 554 print "%s prompt to start your script." % deb.prompt
555 555 ns = {'execfile': py3compat.execfile, 'prog_ns': prog_ns}
556 556 try:
557 #save filename so it can be used by methods on the deb object
558 deb._exec_filename = filename
557 559 deb.run('execfile("%s", prog_ns)' % filename, ns)
558 560
559 561 except:
General Comments 0
You need to be logged in to leave comments. Login now