From 08ff7078ee4ac3f5a319390b709e8075445101ea Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 5 Feb 2010 11:28:37 -0800 Subject: [PATCH] Split long string literals at 2000 chars. (There may not be enough line breaks...) --- Cython/Compiler/StringEncoding.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)]) -- 2.26.2