~ps-jenkins/friends/latestsnapshot-0.2.0daily13.05.07.1-0ubuntu1

« back to all changes in this revision

Viewing changes to friends/utils/time.py

  • Committer: Robert Bruce Park
  • Date: 2013-05-01 17:05:12 UTC
  • mfrom: (160.11.31 trunk-next)
  • Revision ID: robert.park@canonical.com-20130501170512-d3xrvv4vmv24k3ir
Land trunk-next into lp:friends.

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.