diff options
author | Armin Rigo <arigo@tunes.org> | 2011-12-07 20:34:36 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2011-12-07 20:34:36 +0100 |
commit | 16e3d7477efecca2547ef237ab445ffb26b821b0 (patch) | |
tree | 6ef1b3c2752c9234bff9e01533900efb8b8f4423 /py | |
parent | add a simple wrapper and some tests (diff) | |
download | pypy-16e3d7477efecca2547ef237ab445ffb26b821b0.tar.gz pypy-16e3d7477efecca2547ef237ab445ffb26b821b0.tar.bz2 pypy-16e3d7477efecca2547ef237ab445ffb26b821b0.zip |
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.)
Diffstat (limited to 'py')
-rw-r--r-- | py/_code/code.py | 1 |
1 files changed, 1 insertions, 0 deletions
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 |