dabo Commit
Revision 4261
Date: 2008-07-09 13:48:53 -0700 (Wed, 09 Jul 2008)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/4261

Changed:
U   trunk/dabo/lib/dates.py

Log:
[4183] introduced the incorrect error class in the try: block. We should be
checking for ValueError from time.strptime(), not IndexError.


Diff:
Modified: trunk/dabo/lib/dates.py
===================================================================
--- trunk/dabo/lib/dates.py     2008-07-09 20:37:14 UTC (rev 4260)
+++ trunk/dabo/lib/dates.py     2008-07-09 20:48:53 UTC (rev 4261)
@@ -146,7 +146,7 @@
                        # Fall back to the current locale setting in user's os 
account:
                        try:
                                ret = datetime.date(*time.strptime(strVal, 
"%x")[:3])
-                       except IndexError:
+                       except ValueError:  ## ValueError from time.strptime()
                                pass
        return ret
 
@@ -217,7 +217,7 @@
                        # Fall back to the current locale setting in user's os 
account:
                        try:
                                ret = datetime.datetime(*time.strptime(strVal, 
"%x %X")[:7])
-                       except IndexError:
+                       except ValueError:  ## ValueError from time.strptime()
                                pass
        return ret
 




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to