From: Neal Norwitz Date: Wed, 13 Mar 2002 03:14:26 +0000 (+0000) Subject: SF #515015, raise exception if code not found in findsource() X-Git-Tag: v2.3c1~6505 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a11f5dc7bc755039873da04c67566acb7180efa;p=python SF #515015, raise exception if code not found in findsource() --- diff --git a/Lib/inspect.py b/Lib/inspect.py index e55edcab28..806f526690 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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."""