[Numpy-svn] r6193 - trunk/numpy/f2py

numpy-svn@scip... numpy-svn@scip...
Tue Dec 23 03:02:23 CST 2008


Author: pearu
Date: 2008-12-23 03:02:15 -0600 (Tue, 23 Dec 2008)
New Revision: 6193

Modified:
   trunk/numpy/f2py/rules.py
Log:
Fix issue 964: f2py python 2.6, 2.6.1 support.

Modified: trunk/numpy/f2py/rules.py
===================================================================
--- trunk/numpy/f2py/rules.py	2008-12-23 04:11:12 UTC (rev 6192)
+++ trunk/numpy/f2py/rules.py	2008-12-23 09:02:15 UTC (rev 6193)
@@ -245,7 +245,7 @@
 f2py_start_clock();
 #endif
 \tif (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\\
-\t\t\"#argformat#|#keyformat##xaformat#:#pyname#\",\\
+\t\t\"#argformat##keyformat##xaformat#:#pyname#\",\\
 \t\tcapi_kwlist#args_capi##keys_capi##keys_xa#))\n\t\treturn NULL;
 #frompyobj#
 /*end of frompyobj*/
@@ -1355,6 +1355,16 @@
             rd['latexdocstrsigns']=rd['latexdocstrsigns']+rd[k][0:1]+\
                                     ['\\begin{description}']+rd[k][1:]+\
                                     ['\\end{description}']
+
+    # Workaround for Python 2.6, 2.6.1 bug: http://bugs.python.org/issue4720
+    if rd['keyformat'] or rd['xaformat']:
+        argformat = rd['argformat']
+        if isinstance(argformat, list):
+            argformat.append('|')
+        else:
+            assert isinstance(argformat, str),repr((argformat, type(argformat)))
+            rd['argformat'] += '|'
+
     ar=applyrules(routine_rules,rd)
     if ismoduleroutine(rout):
         outmess('\t\t\t  %s\n'%(ar['docshort']))



More information about the Numpy-svn mailing list