]> granicus.if.org Git - python/commitdiff
SF #515015, raise exception if code not found in findsource()
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 13 Mar 2002 03:14:26 +0000 (03:14 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 13 Mar 2002 03:14:26 +0000 (03:14 +0000)
Lib/inspect.py

index e55edcab2892ac5a259c68dcd304612ac87a91d5..806f52669079427552480353b694284e5e477802 100644 (file)
@@ -406,6 +406,7 @@ def findsource(object):
             if pat.match(lines[lnum]): break
             lnum = lnum - 1
         return lines, lnum
+    raise IOError, 'could not find code object'
 
 def getcomments(object):
     """Get lines of comments immediately preceding an object's source code."""