diff options
author | Robert Bradshaw <robertwb@math.washington.edu> | 2010-02-05 11:28:37 -0800 |
---|---|---|
committer | Robert Bradshaw <robertwb@math.washington.edu> | 2010-02-05 11:28:37 -0800 |
commit | 08ff7078ee4ac3f5a319390b709e8075445101ea (patch) | |
tree | 53f9b32547dce43e28c5c10948338f461b5aab14 /Cython/Compiler/StringEncoding.py | |
parent | fe22f9acc9442f0edd271bb9a6d92afc101cb1f2 (diff) | |
download | cython-08ff7078ee4ac3f5a319390b709e8075445101ea.tar.gz |
Split long string literals at 2000 chars.
(There may not be enough line breaks...)
Diffstat (limited to 'Cython/Compiler/StringEncoding.py')
-rw-r--r-- | Cython/Compiler/StringEncoding.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/StringEncoding.py b/Cython/Compiler/StringEncoding.py index 8f97b15d0..cd7900143 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)]) |