Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a668cf3

Browse files
committed
Remove unneeded Pdb.checkline override
Closes #6572
1 parent 1db08a1 commit a668cf3

1 file changed

Lines changed: 0 additions & 33 deletions

File tree

IPython/core/debugger.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -558,36 +558,3 @@ def do_psource(self, arg):
558558
namespaces = [('Locals', self.curframe.f_locals),
559559
('Globals', self.curframe.f_globals)]
560560
self.shell.find_line_magic('psource')(arg, namespaces=namespaces)
561-
562-
def checkline(self, filename, lineno):
563-
"""Check whether specified line seems to be executable.
564-
565-
Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
566-
line or EOF). Warning: testing is not comprehensive.
567-
"""
568-
#######################################################################
569-
# XXX Hack! Use python-2.5 compatible code for this call, because with
570-
# all of our changes, we've drifted from the pdb api in 2.6. For now,
571-
# changing:
572-
#
573-
#line = linecache.getline(filename, lineno, self.curframe.f_globals)
574-
# to:
575-
#
576-
line = linecache.getline(filename, lineno)
577-
#
578-
# does the trick. But in reality, we need to fix this by reconciling
579-
# our updates with the new Pdb APIs in Python 2.6.
580-
#
581-
# End hack. The rest of this method is copied verbatim from 2.6 pdb.py
582-
#######################################################################
583-
584-
if not line:
585-
print('End of file', file=self.stdout)
586-
return 0
587-
line = line.strip()
588-
# Don't allow setting breakpoint at a blank line
589-
if (not line or (line[0] == '#') or
590-
(line[:3] == '"""') or line[:3] == "'''"):
591-
print('*** Blank or comment', file=self.stdout)
592-
return 0
593-
return lineno

0 commit comments

Comments
 (0)