diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2023-05-21 18:42:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 18:42:26 (GMT) |
commit | 0c5e79bcdf99a6a07c65b0ea6d7701b6e041481c (patch) | |
tree | f753a9d7ea638ecdd4943e383f35108b3f2cd181 /Lib/idlelib | |
parent | ffe47cb623999db05959ec4b5168d1c87a1e40ef (diff) | |
download | cpython-0c5e79bcdf99a6a07c65b0ea6d7701b6e041481c.zip cpython-0c5e79bcdf99a6a07c65b0ea6d7701b6e041481c.tar.gz cpython-0c5e79bcdf99a6a07c65b0ea6d7701b6e041481c.tar.bz2 |
gh-104719: IDLE - delete useless monkeypatch of tokenize (#104726)
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/editor.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 21402ad..df36be87 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 ### |