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

numpy-svn@scip... numpy-svn@scip...
Sat Jun 19 08:41:39 CDT 2010


Author: ptvirtan
Date: 2010-06-19 08:41:39 -0500 (Sat, 19 Jun 2010)
New Revision: 8463

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

Modified: trunk/numpy/f2py/capi_maps.py
===================================================================
--- trunk/numpy/f2py/capi_maps.py	2010-06-10 21:22:01 UTC (rev 8462)
+++ trunk/numpy/f2py/capi_maps.py	2010-06-19 13:41:39 UTC (rev 8463)
@@ -435,7 +435,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