mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #16504: Catch SyntaxErrors raised by tokenizer in IDLE.
Patch by Roger Serwy.
This commit is contained in:
commit
ffa1795461
2 changed files with 4 additions and 1 deletions
|
@ -1621,7 +1621,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue