Staging
v0.8.1
https://github.com/python/cpython
Revision 01b53e1f068d20ce3a9dace58f45be82b7eb85c6 authored by Johannes Gijsbers on 31 December 2004, 09:45:37 UTC, committed by Johannes Gijsbers on 31 December 2004, 09:45:37 UTC
more. Thanks to Simon Percivall!

The patch makes changes to inspect.py in two places:

* the pattern to match against functions at line 436 is
modified: lambdas should be matched even if not
preceded by whitespace, as long as "lambda" isn't part
of another word.

* the BlockFinder class is heavily modified. Changes are:
- checking for "def", "class" or "lambda" names
before setting self.started to True. Then checking the
same line for word characters after the colon (if the
colon is on that line). If so, and the line does not
end with a line continuation marker, raise EndOfBlock
immediately.
- adding self.passline to show that the line is to be
included and no more checking is necessary on that
line. Since a NEWLINE token is not generated when a
line continuation marker exists, this allows getsource
to continue with these functions even if the following
line would not be indented.

Don't backport the tests, as these have been too heavily modified on the trunk.
1 parent 4dc49d6
History
Tip revision: 01b53e1f068d20ce3a9dace58f45be82b7eb85c6 authored by Johannes Gijsbers on 31 December 2004, 09:45:37 UTC
Patch #1011890: fix inspect.getsource breaking with line-continuation &
Tip revision: 01b53e1
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
RISCOS
Tools
.cvsignore -rw-r--r-- 109 bytes
.hgtags -rw-r--r-- 2.5 KB
LICENSE -rw-r--r-- 12.9 KB
Makefile.pre.in -rw-r--r-- 31.6 KB
README -rw-r--r-- 48.6 KB
aclocal.m4 -rw-r--r-- 2.1 KB
configure -rwxr-xr-x 572.0 KB
configure.in -rw-r--r-- 84.8 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 23.8 KB
setup.py -rw-r--r-- 52.1 KB

README

back to top