[Python-checkins] cpython (merge 3.2 -> 3.3): Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE.

serhiy.storchaka python-checkins at python.org
Thu Dec 27 21:05:15 CET 2012


http://hg.python.org/cpython/rev/f111e7078d54
changeset: 81092:f111e7078d54
branch: 3.3
parent: 81088:e8248e597060
parent: 81091:e1ef04cfb57c
user: Serhiy Storchaka <storchaka at gmail.com>
date: Thu Dec 27 21:53:06 2012 +0200
summary:
 Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE.
Patch by Roger Serwy.
files:
 Lib/idlelib/EditorWindow.py | 2 +-
 Misc/NEWS | 3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1621,7 +1621,7 @@
 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
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -117,6 +117,9 @@
 Library
 -------
 
+- Issue #16504: IDLE now catches SyntaxErrors raised by tokenizer. Patch by
+ Roger Serwy.
+
 - Issue #16618: Make glob.glob match consistently across strings and bytes
 regarding leading dots. Patch by Serhiy Storchaka.
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /