From 73d91a6b903497a7ad38aab97f48e51f21a1e5df Mon Sep 17 00:00:00 2001 From: David Cournapeau Date: Fri, 15 Aug 2008 12:30:37 +0000 Subject: Split generated docstring literals for compilers which cannot handle long strings.z --- numpy/core/code_generators/generate_umath.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'numpy') diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py index 4fe24fae2..ba57d53e0 100644 --- a/numpy/core/code_generators/generate_umath.py +++ b/numpy/core/code_generators/generate_umath.py @@ -673,6 +673,10 @@ def make_ufuncs(funcdict): mlist = [] docstring = textwrap.dedent(uf.docstring).strip() docstring = docstring.encode('string-escape').replace(r'"', r'\"') + # Split the docstring because some compilers (like MS) do not like big + # string literal in C code. We split at endlines because textwrap.wrap + # do not play well with \n + docstring = '\\n\"\"'.join(docstring.split(r"\n")) mlist.append(\ r"""f = PyUFunc_FromFuncAndData(%s_functions, %s_data, %s_signatures, %d, %d, %d, %s, "%s", -- cgit v1.2.1