From 5e92c5fccf397c7fd9ff3e2ca04fbff20814a72b Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Wed, 13 Mar 2002 03:19:18 +0000 Subject: [PATCH] SF #515015, raise exception if code not found in findsource() --- Lib/inspect.py | 1 + 1 file changed, 1 insertion(+) 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.""" -- 2.47.3