File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1139,9 +1139,10 @@ def move_current_stdouterr_line_up(self):
1139
1139
1140
1140
def send_to_stdout (self , output ):
1141
1141
"""Send unicode string to Repl stdout"""
1142
- if not output : return
1142
+ if not output :
1143
+ return
1143
1144
lines = output .split ('\n ' )
1144
- if output == len ( output ) * ' \n ' :
1145
+ if all ( not line for line in lines ) :
1145
1146
# If the string consist only of newline characters,
1146
1147
# str.split returns one more empty strings.
1147
1148
lines = lines [:- 1 ]
@@ -1165,9 +1166,10 @@ def send_to_stderr(self, error):
1165
1166
1166
1167
Must be able to handle FmtStrs because interpreter pass in
1167
1168
tracebacks already formatted."""
1168
- if not error : return
1169
+ if not error :
1170
+ return
1169
1171
lines = error .split ('\n ' )
1170
- if error == len ( error ) * ' \n ' :
1172
+ if all ( not line for line in lines ) :
1171
1173
# If the string consist only of newline characters,
1172
1174
# str.split returns one more empty strings.
1173
1175
lines = lines [:- 1 ]
You can’t perform that action at this time.
0 commit comments