Dirkjan Ochtman <[email protected]> added the comment:
Here's a test case that doesn't require doctest trickery:
import inspect, linecache
fn, source = '<test>', 'def x(): pass\n'
getlines = linecache.getlines
def monkey(filename, module_globals=None):
if filename == fn:
return source.splitlines(True)
else:
return getlines(filename, module_globals)
linecache.getlines = monkey
exec compile(source, fn, 'single') in globals()
inspect.getsource(x)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9284>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com