summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-03-13 03:14:26 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-03-13 03:14:26 (GMT)
commit8a11f5dc7bc755039873da04c67566acb7180efa (patch)
tree2b91a3ad9bd058bcf529c8a37ae9432ac3db6f0f /Lib
parente789ea19c1e528f3d62b2f62c0ae643de9705909 (diff)
downloadcpython-8a11f5dc7bc755039873da04c67566acb7180efa.zip
cpython-8a11f5dc7bc755039873da04c67566acb7180efa.tar.gz
cpython-8a11f5dc7bc755039873da04c67566acb7180efa.tar.bz2
SF #515015, raise exception if code not found in findsource()
Diffstat (limited to 'Lib')
-rw-r--r--Lib/inspect.py1
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."""