gh-104719: IDLE - delete useless monkeypatch of tokenize (#104726)

This commit is contained in:
Terry Jan Reedy 2023-05-21 14:42:26 -04:00 committed by GitHub
parent ffe47cb623
commit 0c5e79bcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 12 deletions

View File

@ -1643,19 +1643,13 @@ class IndentSearcher:
self.finished = 1
def run(self):
save_tabsize = tokenize.tabsize
tokenize.tabsize = self.tabwidth
try:
try:
tokens = tokenize.generate_tokens(self.readline)
for token in tokens:
self.tokeneater(*token)
except (tokenize.TokenError, SyntaxError):
# since we cut off the tokenizer early, we can trigger
# spurious errors
pass
finally:
tokenize.tabsize = save_tabsize
tokens = tokenize.generate_tokens(self.readline)
for token in tokens:
self.tokeneater(*token)
except (tokenize.TokenError, SyntaxError):
# Stopping the tokenizer early can trigger spurious errors.
pass
return self.blkopenline, self.indentedline
### end autoindent code ###