Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-104719: IDLE - delete useless monkeypatch of tokenize (GH-104726)
(cherry picked from commit 0c5e79b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
  • Loading branch information
terryjreedy authored and miss-islington committed May 21, 2023
commit 6e53c23921afb21599f90cc39e6dc6cf75827517
18 changes: 6 additions & 12 deletions Lib/idlelib/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,19 +1643,13 @@ def tokeneater(self, type, token, start, end, line,
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 ###
Expand Down