'Check whether specified line seems to be executable.
Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
line or EOF). Warning: testing is not comprehensive.'

def checkline(self, filename, lineno):

    globs = (self.curframe.f_globals if hasattr(self, 'curframe') else None)
    line = linecache.getline(filename, lineno, globs)
    if (not line):
        print >>self.stdout, 'End    of    file'
        return 0
    line = line.strip()
    if ((not line) or (line[0] == '#') or (line[:3] == '"""') or (line[:3] == "'''")):
        print >>self.stdout, '***    Blank    or    comment'
        return 0
    return lineno
