[issue4335] inspect.getsourcelines ignores last line in module

Alexander Belopolsky report at bugs.python.org
Tue Dec 9 16:10:20 CET 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Just to add to the list of getsource quirks: with the following in x.py,

f = lambda: 0 \
[EOF]

>>> import inspect, x; inspect.getsource(x.f)
Traceback (most recent call last):
..
tokenize.TokenError: ('EOF in multi-line statement', (2, 0))

Same with

def f():
    0 \
[EOF]

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4335>
_______________________________________


More information about the Python-bugs-list mailing list