From 476a23b91ff39affbbb49c00a9bec94ac50d6e0f Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 9 Jun 2008 14:50:57 +0200 Subject: [PATCH] fix error context output --- Cython/Compiler/Errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2