mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
_split_ascii(): In the clause where curlen + partlen > maxlen, if the
part itself is longer than maxlen, and we aren't already splitting on whitespace, then we recursively split the part on whitespace and append that to the this list.
This commit is contained in:
parent
f0d3585669
commit
bd836dfba3
1 changed files with 8 additions and 1 deletions
|
@ -456,7 +456,14 @@ def _split_ascii(s, firstlen, restlen, continuation_ws, splitchars):
|
|||
elif curlen + partlen > maxlen:
|
||||
if this:
|
||||
lines.append(joiner.join(this) + eol)
|
||||
this = [part]
|
||||
# If this part is longer than maxlen and we aren't already
|
||||
# splitting on whitespace, try to recursively split this line
|
||||
# on whitespace.
|
||||
if partlen > maxlen and ch <> ' ':
|
||||
this = [_split_ascii(part, maxlen, restlen,
|
||||
continuation_ws, ' ')]
|
||||
else:
|
||||
this = [part]
|
||||
linelen = wslen + partlen
|
||||
maxlen = restlen
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue