From 16e3d7477efecca2547ef237ab445ffb26b821b0 Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Wed, 7 Dec 2011 20:34:36 +0100 Subject: Fix an occasional IndexError. (I should try to figure out if the trunk py lib still has the same issue, and write a test for it if it does, but I don't really follow the trunk py lib, so I'm just checking this here and it can be ignored if we update the py lib.) --- py/_code/code.py | 1 + 1 file changed, 1 insertion(+) (limited to 'py') diff --git a/py/_code/code.py b/py/_code/code.py index e83db25828..48c31f535b 100644 --- a/py/_code/code.py +++ b/py/_code/code.py @@ -164,6 +164,7 @@ class TracebackEntry(object): # if something: # assume this causes a NameError # # _this_ lines and the one # below we don't want from entry.getsource() + end = min(end, len(source)) for i in range(self.lineno, end): if source[i].rstrip().endswith(':'): end = i + 1 -- cgit v1.2.3-65-gdbad