Show More
@@ -520,3 +520,36 b' class Pdb(OldPdb):' | |||
|
520 | 520 | namespaces = [('Locals', self.curframe.f_locals), |
|
521 | 521 | ('Globals', self.curframe.f_globals)] |
|
522 | 522 | __IPYTHON__.magic_pinfo("pinfo %s" % arg, namespaces=namespaces) |
|
523 | ||
|
524 | def checkline(self, filename, lineno): | |
|
525 | """Check whether specified line seems to be executable. | |
|
526 | ||
|
527 | Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank | |
|
528 | line or EOF). Warning: testing is not comprehensive. | |
|
529 | """ | |
|
530 | ####################################################################### | |
|
531 | # XXX Hack! Use python-2.5 compatible code for this call, because with | |
|
532 | # all of our changes, we've drifted from the pdb api in 2.6. For now, | |
|
533 | # changing: | |
|
534 | # | |
|
535 | #line = linecache.getline(filename, lineno, self.curframe.f_globals) | |
|
536 | # to: | |
|
537 | # | |
|
538 | line = linecache.getline(filename, lineno) | |
|
539 | # | |
|
540 | # does the trick. But in reality, we need to fix this by reconciling | |
|
541 | # our updates with the new Pdb APIs in Python 2.6. | |
|
542 | # | |
|
543 | # End hack. The rest of this method is copied verbatim from 2.6 pdb.py | |
|
544 | ####################################################################### | |
|
545 | ||
|
546 | if not line: | |
|
547 | print >>self.stdout, 'End of file' | |
|
548 | return 0 | |
|
549 | line = line.strip() | |
|
550 | # Don't allow setting breakpoint at a blank line | |
|
551 | if (not line or (line[0] == '#') or | |
|
552 | (line[:3] == '"""') or line[:3] == "'''"): | |
|
553 | print >>self.stdout, '*** Blank or comment' | |
|
554 | return 0 | |
|
555 | return lineno |
General Comments 0
You need to be logged in to leave comments.
Login now