File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -140,21 +140,21 @@ def get_width():
140140 # The Windows get_terminal_size may be bogus, let's sanify a bit.
141141 if width < 40 :
142142 width = 80
143- # The goal is to have the line be as long as possible
144- # under the condition that len(line) <= fullwidth.
145- if sys .platform == 'win32' :
146- # If we print in the last column on windows we are on a
147- # new line but there is no way to verify/neutralize this
148- # (we may not know the exact line width).
149- # So let's be defensive to avoid empty lines in the output.
150- width -= 1
151143 return width
152144
153145 def sep (self , stream , s , txt ):
154146 if hasattr (stream , 'sep' ):
155147 stream .sep (s , txt )
156148 else :
157149 fullwidth = self .get_width ()
150+ # The goal is to have the line be as long as possible
151+ # under the condition that len(line) <= fullwidth.
152+ if sys .platform == 'win32' :
153+ # If we print in the last column on windows we are on a
154+ # new line but there is no way to verify/neutralize this
155+ # (we may not know the exact line width).
156+ # So let's be defensive to avoid empty lines in the output.
157+ fullwidth -= 1
158158 N = max ((fullwidth - len (txt ) - 2 ) // (2 * len (s )), 1 )
159159 fill = s * N
160160 line = f'{ fill } { txt } { fill } '
You can’t perform that action at this time.
0 commit comments