summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-01-19 13:21:20 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-01-19 13:21:20 (GMT)
commit2e7b748a9ecc2d21abe0ecf93e079ac53385c371 (patch)
tree65f2d52333044c9f6e6d48b7052061089a79908d /Lib/inspect.py
parente701dcbabd43cfc9dc77e6f8b3e0325accec4164 (diff)
downloadcpython-2e7b748a9ecc2d21abe0ecf93e079ac53385c371.zip
cpython-2e7b748a9ecc2d21abe0ecf93e079ac53385c371.tar.gz
cpython-2e7b748a9ecc2d21abe0ecf93e079ac53385c371.tar.bz2
SF patch #634557: inspect.BlockFinder didn't do a good enough job finding
the end of code blocks. Patch contributed by Patrick O'Brien.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 77129fd..80f65b53 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -501,6 +501,8 @@ class BlockFinder:
elif type == tokenize.DEDENT:
self.indent = self.indent - 1
if self.indent == 0: raise EndOfBlock, self.last
+ elif type == tokenize.NAME and scol == 0:
+ raise EndOfBlock, self.last
def getblock(lines):
"""Extract the block of code at the top of the given list of lines."""