Commit 4479643d authored by david@evans-2.local's avatar david@evans-2.local

Split docstring around \n for compilers who barf at long string literals (VS 2003).

parent ba2630d1
......@@ -13,7 +13,7 @@ from PyrexTypes import py_object_type, error_type, CTypedefType, CFuncType
from Symtab import ModuleScope, LocalScope, GeneratorLocalScope, \
StructOrUnionScope, PyClassScope, CClassScope
from Cython.Utils import open_new_file, replace_suffix
from StringEncoding import EncodedString, escape_byte_string
from StringEncoding import EncodedString, escape_byte_string, split_docstring
import Options
import ControlFlow
......@@ -1533,7 +1533,7 @@ class DefNode(FuncDefNode):
code.putln(
'static char %s[] = "%s";' % (
self.entry.doc_cname,
escape_byte_string(docstr)))
split_docstring(escape_byte_string(docstr))))
if with_pymethdef:
code.put(
"static PyMethodDef %s = " %
......
......@@ -142,3 +142,6 @@ def escape_byte_string(s):
else:
append(c)
return ''.join(l)
def split_docstring(s):
return '\\n\"\"'.join(s.split(r'\n'))
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