File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 106106 # work around a bug where even though we specified binary encoding we get
107107 # the sys.stdin instead.
108108 args .fd = sys .stdin .buffer
109- padded_lines = [b'\x00 ' + line .rstrip ().ljust (args .min_len ) + b'\x00 ' for line in args .fd .readlines ()]
109+ raw_padded_lines = [b'\x00 ' + line .rstrip ().ljust (args .min_len ) + b'\x00 ' for line in args .fd .readlines ()]
110+
111+ # combine lines if < MAX_SCRIPT_ELEMENT_SIZE
112+ padded_lines = []
113+ prev_line = b'\x00 '
114+ for line in raw_padded_lines :
115+ if len (prev_line ) + len (line ) <= MAX_SCRIPT_ELEMENT_SIZE :
116+ prev_line = prev_line + line [1 :]
117+
118+ else :
119+ padded_lines .append (prev_line )
120+ prev_line = line
121+
122+ if prev_line :
123+ padded_lines .append (prev_line )
110124
111125scripts = []
112126while padded_lines :
You can’t perform that action at this time.
0 commit comments