Commits

Mike Fogel committed 14c616d

Tighten up regex for microseconds in parse()

Comments (0)

Files changed (1)

timedelta/helpers.py

     # This is the format we get from sometimes Postgres, sqlite,
     # and from serialization
     d = re.match(r'((?P<days>\d+) days?,? )?(?P<hours>\d+):'
-                 r'(?P<minutes>\d+)(:(?P<seconds>[\.\d]+))?',
+                 r'(?P<minutes>\d+)(:(?P<seconds>\d+(\.\d+)?))?',
                  unicode(string))
     if d: 
         d = d.groupdict(0)