Skip to content

Commit

Permalink
[3.11] gh-104719: IDLE - delete useless monkeypatch of tokenize (GH-1…
Browse files Browse the repository at this point in the history
…04726) (#104727)

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
miss-islington and terryjreedy committed May 21, 2023
1 parent abb32de commit e033eda
Showing 1 changed file with 6 additions and 12 deletions.
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

0 comments on commit e033eda

Please sign in to comment.