[Numpy-svn] r5655 - trunk/numpy/core/code_generators

numpy-svn@scip... numpy-svn@scip...
Fri Aug 15 07:30:39 CDT 2008


Author: cdavid
Date: 2008-08-15 07:30:37 -0500 (Fri, 15 Aug 2008)
New Revision: 5655

Modified:
   trunk/numpy/core/code_generators/generate_umath.py
Log:
Split generated docstring literals for compilers which cannot handle long strings.z

Modified: trunk/numpy/core/code_generators/generate_umath.py
===================================================================
--- trunk/numpy/core/code_generators/generate_umath.py	2008-08-14 22:30:17 UTC (rev 5654)
+++ trunk/numpy/core/code_generators/generate_umath.py	2008-08-15 12:30:37 UTC (rev 5655)
@@ -673,6 +673,10 @@
         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",



More information about the Numpy-svn mailing list