summaryrefslogtreecommitdiff
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2012-12-27 21:38:04 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2012-12-27 21:38:04 +0200
commit07e0e06f8a255a73d181e332dd8658814eb1ca50 (patch)
tree1b611b45e24e3134804ac72adc103c8258746e84 /Lib/idlelib
parentc8bd74ddfd5a41e8f37181bf4ba3c9e37b6d65b1 (diff)
downloadcpython-git-07e0e06f8a255a73d181e332dd8658814eb1ca50.tar.gz
Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE.
Patch by Roger Serwy.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/EditorWindow.py2
1 files changed, 1 insertions, 1 deletions
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