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

Skip to content

Commit 8a11f5d

Browse files
committed
SF #515015, raise exception if code not found in findsource()
1 parent e789ea1 commit 8a11f5d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Lib/inspect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ def findsource(object):
406406
if pat.match(lines[lnum]): break
407407
lnum = lnum - 1
408408
return lines, lnum
409+
raise IOError, 'could not find code object'
409410

410411
def getcomments(object):
411412
"""Get lines of comments immediately preceding an object's source code."""

0 commit comments

Comments
 (0)