New submission from Rafe Sacks <[EMAIL PROTECTED]>:
Hi,
If the last line of the function is also the last line of the module, it
is ignored. To repro:
1) Create module 'repro'
<module>
def test():
module_line_2 = None
module_line_3 = None
module_line_4 = None
module_line_5 = None
<end module>
2) Run test:
>>> import repro
>>> import inspect
>>> inspect.getsourcelines(tmp.test)
(['def test():\n', ' module_line_2 = None\n', ' module_line_3 =
None\n', ' module_line_4 = None\n'], 1)
notice no module_line_5.
cheers,
- Rafe
----------
components: Library (Lib)
messages: 75953
nosy: RafeSacks
severity: normal
status: open
title: inspect.getsourcelines ignores last line in module
versions: Python 2.5
_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4335>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com