From 0c5e79bcdf99a6a07c65b0ea6d7701b6e041481c Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 21 May 2023 14:42:26 -0400 Subject: [PATCH] gh-104719: IDLE - delete useless monkeypatch of tokenize (#104726) --- Lib/idlelib/editor.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 21402ad7139..df36be87660 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -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 ###