Skip to content

Commit 997117a

Browse files
Attila Szöllősisebastinas
authored andcommitted
Changes requested by sebastinas
1 parent 724f3b9 commit 997117a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,9 +1139,10 @@ def move_current_stdouterr_line_up(self):
11391139

11401140
def send_to_stdout(self, output):
11411141
"""Send unicode string to Repl stdout"""
1142-
if not output: return
1142+
if not output:
1143+
return
11431144
lines = output.split('\n')
1144-
if output == len(output) * '\n':
1145+
if all(not line for line in lines):
11451146
# If the string consist only of newline characters,
11461147
# str.split returns one more empty strings.
11471148
lines = lines[:-1]
@@ -1165,9 +1166,10 @@ def send_to_stderr(self, error):
11651166
11661167
Must be able to handle FmtStrs because interpreter pass in
11671168
tracebacks already formatted."""
1168-
if not error: return
1169+
if not error:
1170+
return
11691171
lines = error.split('\n')
1170-
if error == len(error) * '\n':
1172+
if all(not line for line in lines):
11711173
# If the string consist only of newline characters,
11721174
# str.split returns one more empty strings.
11731175
lines = lines[:-1]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy