From 07e0e06f8a255a73d181e332dd8658814eb1ca50 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 27 Dec 2012 21:38:04 +0200 Subject: Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE. Patch by Roger Serwy. --- Lib/idlelib/EditorWindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/idlelib/EditorWindow.py') diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 48aabc8f69..16f63c52a4 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -1618,7 +1618,7 @@ class IndentSearcher(object): tokens = _tokenize.generate_tokens(self.readline) for token in tokens: self.tokeneater(*token) - except _tokenize.TokenError: + except (_tokenize.TokenError, SyntaxError): # since we cut off the tokenizer early, we can trigger # spurious errors pass -- cgit v1.2.1