[Scipy-svn] r4455 - trunk/scipy/stats/models

scipy-svn@scip... scipy-svn@scip...
Sat Jun 21 04:04:58 CDT 2008


Author: wnbell
Date: 2008-06-21 04:04:55 -0500 (Sat, 21 Jun 2008)
New Revision: 4455

Modified:
   trunk/scipy/stats/models/formula.py
Log:
should fix ticket #611
the code seemed to be capturing the wrong Exception type


Modified: trunk/scipy/stats/models/formula.py
===================================================================
--- trunk/scipy/stats/models/formula.py	2008-06-20 16:37:47 UTC (rev 4454)
+++ trunk/scipy/stats/models/formula.py	2008-06-21 09:04:55 UTC (rev 4455)
@@ -269,9 +269,9 @@
         if reference is None:
             reference = 0
         else:
-            try:
+            if reference in names:
                 reference = names.index(reference)
-            except IndexError:
+            else:
                 reference = int(reference)
 
         def maineffect_func(value, reference=reference):



More information about the Scipy-svn mailing list