10000 gh-104719: IDLE - delete useless monkeypatch of tokenize (#104726) · python/cpython@0c5e79b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c5e79b

Browse files
authored
gh-104719: IDLE - delete useless monkeypatch of tokenize (#104726)
1 parent ffe47cb commit 0c5e79b

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Lib/idlelib/editor.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -1643,19 +1643,13 @@ def tokeneater(self, type, token, start, end, line,
16431643
self.finished = 1
16441644

16451645
def run(self):
1646-
save_tabsize = tokenize.tabsize
1647-
tokenize.tabsize = self.tabwidth
16481646
try:
1649-
try:
1650-
tokens = tokenize.generate_tokens(self.readline)
1651-
for token in tokens:
1652-
self.tokeneater(*token)
1653-
except (tokenize.TokenError, SyntaxError):
1654-
# since we cut off the tokenizer early, we can trigger
1655-
# spurious errors
1656-
pass
1657-
finally:
1658-
tokenize.tabsize = save_tabsize
1647+
tokens = tokenize.generate_tokens(self.readline)
1648+
for token in tokens:
1649+
self.tokeneater(*token)
1650+
except (tokenize.TokenError, SyntaxError):
1651+
# Stopping the tokenizer early can trigger spurious errors.
1652+
pass
16591653
return self.blkopenline, self.indentedline
16601654

16611655
### end autoindent code ###

0 commit comments

Comments
 (0)
0