X Tutup
Skip to content

Commit 36d01b6

Browse files
fix stdin read with blank prompt
1 parent b6230d9 commit 36d01b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def run_code_and_maybe_finish(self, for_code=None):
511511
#TODO This should be printed ABOVE the error that just happened instead
512512
# or maybe just thrown away and not shown
513513
if self.current_stdouterr_line:
514-
self.display_lines.extend(paint.display_linize(self.current_stdouterr_line, self.width))
514+
self.display_lines.extend(paint.display_linize(self.current_stdouterr_line, self.width), blank_line=True)
515515
self.current_stdouterr_line = ''
516516

517517
self._current_line = ' '*indent

bpython/curtsiesfrontend/replpainter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# * return an array of the width they were asked for
1616
# * return an array not taller than the height they were asked for
1717

18-
def display_linize(msg, columns):
18+
def display_linize(msg, columns, blank_line=False):
1919
"""Returns lines obtained by splitting msg over multiple lines.
2020
2121
Warning: if msg is empty, returns an empty list of lines"""
2222
display_lines = ([msg[start:end]
2323
for start, end in zip(
2424
range(0, len(msg), columns),
2525
range(columns, len(msg)+columns, columns))]
26-
if msg else [])
26+
if msg else ([''] if blank_line else []))
2727
return display_lines
2828

2929
def paint_history(rows, columns, display_lines):

0 commit comments

Comments
 (0)
X Tutup