mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
SF #515015, raise exception if code not found in findsource()
This commit is contained in:
parent
e789ea19c1
commit
8a11f5dc7b
1 changed files with 1 additions and 0 deletions
|
@ -406,6 +406,7 @@ def findsource(object):
|
||||||
if pat.match(lines[lnum]): break
|
if pat.match(lines[lnum]): break
|
||||||
lnum = lnum - 1
|
lnum = lnum - 1
|
||||||
return lines, lnum
|
return lines, lnum
|
||||||
|
raise IOError, 'could not find code object'
|
||||||
|
|
||||||
def getcomments(object):
|
def getcomments(object):
|
||||||
"""Get lines of comments immediately preceding an object's source code."""
|
"""Get lines of comments immediately preceding an object's source code."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue