]> granicus.if.org Git - python/commitdiff
Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE.
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 27 Dec 2012 19:34:23 +0000 (21:34 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 27 Dec 2012 19:34:23 +0000 (21:34 +0200)
Lib/idlelib/EditorWindow.py
Misc/NEWS

index efd3c54d9a35a3778f474f7ee21a29b6f600a67b..0a01c9ec3051d3e26ab263b3cc41d70acbde57f4 100644 (file)
@@ -1611,7 +1611,7 @@ class IndentSearcher(object):
         try:
             try:
                 _tokenize.tokenize(self.readline, self.tokeneater)
-            except _tokenize.TokenError:
+            except (_tokenize.TokenError, SyntaxError):
                 # since we cut off the tokenizer early, we can trigger
                 # spurious errors
                 pass
index 7642e6067a17d8293e76a2e587dd3ce2faba4433..9429d4e66503b5c1fbd04c8900c55087029e2904 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -164,6 +164,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #16504: IDLE now catches SyntaxErrors raised by tokenizer. Patch by
+  Roger Serwy.
+
 - Issue #16702: test_urllib2_localnet tests now correctly ignores proxies for
   localhost tests.