Diff of /sqlobject/col.py [800c3e] .. [9b6048]  Maximize  Restore

  Switch to side-by-side view

--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1113,11 +1113,7 @@
                         value = '.'.join(_value)
                 else:
                     value += '.0'
-            if sys.version_info[:3] < (2, 6, 0): # datetime.strptime in python2.5 doesn't support '%f' format
-                stime = time.strptime(value, self.format)
-                return datetime.datetime(*stime[:6])
-            else:
-                return datetime.datetime.strptime(value, self.format)
+            return datetime.datetime.strptime(value, self.format)
         except:
             raise validators.Invalid("expected a date/time string of the '%s' format in the DateTimeCol '%s', got %s %r instead" % \
                 (self.format, self.name, type(value), value), value, state)
@@ -1160,13 +1156,9 @@
                             value = '.'.join(_value)
                     else:
                         value += '.0'
-                if sys.version_info[:3] < (2, 6, 0): # datetime.strptime in python2.5 doesn't support '%f' format
-                    stime = time.strptime(value, self.format)
-                    return DateTime.mktime(stime)
-                else:
-                    value = datetime.datetime.strptime(value, self.format)
-                    return DateTime.DateTime(value.year, value.month, value.day,
-                        value.hour, value.minute, value.second)
+                value = datetime.datetime.strptime(value, self.format)
+                return DateTime.DateTime(value.year, value.month, value.day,
+                    value.hour, value.minute, value.second)
             except:
                 raise validators.Invalid("expected a date/time string of the '%s' format in the DateTimeCol '%s', got %s %r instead" % \
                     (self.format, self.name, type(value), value), value, state)

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks