Skip to content

Commit 711845f

Browse files
committed
Iterate directly over result of get_tokens
1 parent 492e3d5 commit 711845f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bpython/curtsiesfrontend/interpreter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ def format(self, tbtext: str, lexer: Any) -> None:
9696
# FIXME: lexer should is a Lexer
9797
traceback_informative_formatter = BPythonFormatter(default_colors)
9898
traceback_code_formatter = BPythonFormatter({Token: ("d")})
99-
tokens = list(lexer.get_tokens(tbtext))
10099

101100
no_format_mode = False
102101
cur_line = []
103-
for token, text in tokens:
102+
for token, text in lexer.get_tokens(tbtext):
104103
if text.endswith("\n"):
105104
cur_line.append((token, text))
106105
if no_format_mode:

0 commit comments

Comments
 (0)