Null merge.
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index efd3c54..0a01c9e 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1611,7 +1611,7 @@
         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
diff --git a/Misc/NEWS b/Misc/NEWS
index ea9e6bf..9f8c89a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -168,6 +168,9 @@
 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.