From: Robert Bradshaw Date: Fri, 5 Feb 2010 19:28:37 +0000 (-0800) Subject: Split long string literals at 2000 chars. X-Git-Tag: 0.13.beta0~349^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=08ff7078ee4ac3f5a319390b709e8075445101ea;p=cython.git Split long string literals at 2000 chars. (There may not be enough line breaks...) --- diff --git a/Cython/Compiler/StringEncoding.py b/Cython/Compiler/StringEncoding.py index 8f97b15d..cd790014 100644 --- a/Cython/Compiler/StringEncoding.py +++ b/Cython/Compiler/StringEncoding.py @@ -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)])