##// END OF EJS Templates
Fix debugging with breakpoints....
Fernando Perez -
Show More
@@ -477,3 +477,36 b' class Pdb(OldPdb):'
477 namespaces = [('Locals', self.curframe.f_locals),
477 namespaces = [('Locals', self.curframe.f_locals),
478 ('Globals', self.curframe.f_globals)]
478 ('Globals', self.curframe.f_globals)]
479 self.shell.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
479 self.shell.magic_pinfo("pinfo %s" % arg, namespaces=namespaces)
480
481 def checkline(self, filename, lineno):
482 """Check whether specified line seems to be executable.
483
484 Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
485 line or EOF). Warning: testing is not comprehensive.
486 """
487 #######################################################################
488 # XXX Hack! Use python-2.5 compatible code for this call, because with
489 # all of our changes, we've drifted from the pdb api in 2.6. For now,
490 # changing:
491 #
492 #line = linecache.getline(filename, lineno, self.curframe.f_globals)
493 # to:
494 #
495 line = linecache.getline(filename, lineno)
496 #
497 # does the trick. But in reality, we need to fix this by reconciling
498 # our updates with the new Pdb APIs in Python 2.6.
499 #
500 # End hack. The rest of this method is copied verbatim from 2.6 pdb.py
501 #######################################################################
502
503 if not line:
504 print >>self.stdout, 'End of file'
505 return 0
506 line = line.strip()
507 # Don't allow setting breakpoint at a blank line
508 if (not line or (line[0] == '#') or
509 (line[:3] == '"""') or line[:3] == "'''"):
510 print >>self.stdout, '*** Blank or comment'
511 return 0
512 return lineno
General Comments 0
You need to be logged in to leave comments. Login now