From 0245eb9e14ea82d573e367061f376fda67f8577a Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 4 Feb 2012 10:49:17 +0100 Subject: Fix find_error script if error is in very beginning of file. --- scripts/find_error.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/find_error.py') diff --git a/scripts/find_error.py b/scripts/find_error.py index 199e9c5c..1b793790 100755 --- a/scripts/find_error.py +++ b/scripts/find_error.py @@ -123,7 +123,7 @@ def main(fn, lexer=None, options={}): for tok, state in map(None, tokens, states): show_token(tok, state) else: - for i in range(len(tokens) - num, len(tokens)): + for i in range(max(len(tokens) - num, 0), len(tokens)): show_token(tokens[i], states[i]) print 'Error token:' l = len(repr(val)) -- cgit v1.2.1