Fix ein.find_source

This commit is contained in:
Takafumi Arakaki 2012-09-05 01:13:22 +02:00
parent 81a1b64fb0
commit 105f1af2b5

View file

@ -41,13 +41,15 @@ except ImportError:
def find_source(name):
"""Given an object as string, `name`, print its place in source code."""
# FIXME: use JSON display object instead of stdout
ret = _find_edit_target(name, {}, [])
if ret:
(filename, lineno, use_temp) = ret
print filename
print lineno
else:
raise RuntimeError("Source code for {0} cannot be found".format(name))
if not use_temp:
print filename
print lineno
return
raise RuntimeError("Source code for {0} cannot be found".format(name))
def run_docstring_examples(obj, verbose=True):