diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-13 03:14:26 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-13 03:14:26 (GMT) |
commit | 8a11f5dc7bc755039873da04c67566acb7180efa (patch) | |
tree | 2b91a3ad9bd058bcf529c8a37ae9432ac3db6f0f /Lib/inspect.py | |
parent | e789ea19c1e528f3d62b2f62c0ae643de9705909 (diff) | |
download | cpython-8a11f5dc7bc755039873da04c67566acb7180efa.zip cpython-8a11f5dc7bc755039873da04c67566acb7180efa.tar.gz cpython-8a11f5dc7bc755039873da04c67566acb7180efa.tar.bz2 |
SF #515015, raise exception if code not found in findsource()
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index e55edca..806f526 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.""" |