From: Stefan Behnel Date: Mon, 9 Jun 2008 12:50:57 +0000 (+0200) Subject: fix error context output X-Git-Tag: 0.9.8rc1~11^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=476a23b91ff39affbbb49c00a9bec94ac50d6e0f;p=cython.git fix error context output --- diff --git a/Cython/Compiler/Errors.py b/Cython/Compiler/Errors.py index 84a69dee..331ad921 100644 --- a/Cython/Compiler/Errors.py +++ b/Cython/Compiler/Errors.py @@ -18,7 +18,7 @@ def context(position): assert not (isinstance(source, unicode) or isinstance(source, str)), ( "Please replace filename strings with Scanning.FileSourceDescriptor instances %r" % source) F = list(source.get_lines()) - s = ''.join(F[min(0, position[1]-6):position[1]]) + s = ''.join(F[max(0, position[1]-6):position[1]]) s += ' '*(position[2]-1) + '^' s = '-'*60 + '\n...\n' + s + '\n' + '-'*60 + '\n' return s