[Numpy-svn] r8464 - branches/1.4.x/numpy/f2py

numpy-svn@scip... numpy-svn@scip...
Sat Jun 19 08:44:47 CDT 2010


Author: ptvirtan
Date: 2010-06-19 08:44:47 -0500 (Sat, 19 Jun 2010)
New Revision: 8464

Modified:
   branches/1.4.x/numpy/f2py/capi_maps.py
Log:
BUG: f2py: replace a string exception with a real one (fixes #1515)

(cherry picked from commit r8463)

Modified: branches/1.4.x/numpy/f2py/capi_maps.py
===================================================================
--- branches/1.4.x/numpy/f2py/capi_maps.py	2010-06-19 13:41:39 UTC (rev 8463)
+++ branches/1.4.x/numpy/f2py/capi_maps.py	2010-06-19 13:44:47 UTC (rev 8464)
@@ -429,7 +429,8 @@
                 else:
                     v = eval(v,{},{})
                     ret['init.r'],ret['init.i']=str(v.real),str(v.imag)
-            except: raise 'sign2map: expected complex number `(r,i)\' but got `%s\' as initial value of %s.'%(init,`a`)
+            except:
+                raise ValueError('sign2map: expected complex number `(r,i)\' but got `%s\' as initial value of %r.' % (init, a))
             if isarray(var):
                 init='(capi_c.r=%s,capi_c.i=%s,capi_c)'%(ret['init.r'],ret['init.i'])
         elif isstring(var):



More information about the Numpy-svn mailing list