From: Neal Norwitz Date: Wed, 13 Mar 2002 03:19:18 +0000 (+0000) Subject: SF #515015, raise exception if code not found in findsource() X-Git-Tag: v2.2.1c1~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e92c5fccf397c7fd9ff3e2ca04fbff20814a72b;p=thirdparty%2FPython%2Fcpython.git SF #515015, raise exception if code not found in findsource() --- diff --git a/Lib/inspect.py b/Lib/inspect.py index e55edcab2892..806f52669079 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."""