Skip to content

Commit 10072cb

Browse files
committed
Use itertools.chain instead of list addition
1 parent b63051e commit 10072cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import contextlib
33
import errno
44
import greenlet
5+
import itertools
56
import logging
67
import os
78
import re
@@ -1259,7 +1260,9 @@ def send_to_stdouterr(self, output):
12591260
)
12601261
)
12611262
# These can be FmtStrs, but self.all_logical_lines only wants strings
1262-
for line in [self.current_stdouterr_line] + lines[1:-1]:
1263+
for line in itertools.chain(
1264+
(self.current_stdouterr_line,), lines[1:-1]
1265+
):
12631266
if isinstance(line, FmtStr):
12641267
self.all_logical_lines.append((line.s, LineType.OUTPUT))
12651268
else:

0 commit comments

Comments
 (0)