Commit 08ff7078 authored by Robert Bradshaw's avatar Robert Bradshaw

Split long string literals at 2000 chars.

(There may not be enough line breaks...)
parent fe22f9ac
......@@ -186,6 +186,8 @@ def escape_byte_string(s):
return join_bytes(l).decode('ISO-8859-1')
def split_docstring(s):
# MSVC can't handle long string literals.
if len(s) < 2047:
return s
return '\\n\"\"'.join(s.split(r'\n'))
else:
return '""'.join([s[i:i+2000] for i in range(0, len(s), 2000)])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment