~ssweeny/friends/fix-lp1258657

« back to all changes in this revision

Viewing changes to friends/utils/time.py

  • Committer: Andrew Starr-Bochicchio
  • Date: 2013-04-16 17:51:32 UTC
  • mfrom: (160.11.29 trunk-next)
  • mto: This revision was merged to the branch mainline in revision 218.
  • Revision ID: a.starr.b@gmail.com-20130416175132-kurn5v12qr2rhfn1
Merge on lp:~super-friends/friends/trunk-next

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from contextlib import contextmanager
30
30
from datetime import datetime, timedelta
31
31
 
 
32
from friends.errors import ignored
 
33
 
32
34
 
33
35
# Date time formats.  Assume no microseconds and no timezone.
34
36
ISO8601_FORMAT = '%Y-%m-%dT%H:%M:%S'
119
121
            # No timezone string was found.
120
122
            tz_offset = timedelta()
121
123
        for parser in PARSERS:
122
 
            try:
 
124
            with ignored(ValueError):
123
125
                parsed_dt = parser(naive_t)
124
 
            except ValueError:
125
 
                pass
126
 
            else:
127
126
                break
128
127
        else:
129
128
            # Nothing matched.