diff options
author | MinchinWeb <w_minchin@hotmail.com> | 2017-11-13 20:20:11 -0700 |
---|---|---|
committer | MinchinWeb <w_minchin@hotmail.com> | 2017-11-13 20:20:11 -0700 |
commit | 5dc724dd4de7cc66c2750fc3af0e0458d8347d5c (patch) | |
tree | d760bbdc838a646df9c393859476a600f899d3af | |
parent | 779a8f4ddf65ef91486a3ff96f7884f0e044c85c (diff) |
Don't break when system timezone is UTCprjct-0.6.0
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | jrnl/DayOneJournal.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml index 37afaca9..3c476bb9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ +sudo: false language: python +cache: pip python: - "2.7" - "3.3" diff --git a/jrnl/DayOneJournal.py b/jrnl/DayOneJournal.py index f4365db2..c2fd74fb 100644 --- a/jrnl/DayOneJournal.py +++ b/jrnl/DayOneJournal.py @@ -51,7 +51,13 @@ class DayOne(Journal.Journal): except (KeyError, pytz.exceptions.UnknownTimeZoneError): timezone = tzlocal.get_localzone() date = dict_entry['Creation Date'] - date = date + timezone.utcoffset(date, is_dst=False) + try: + date = date + timezone.utcoffset(date, is_dst=False) + except TypeError: + # if the system timezone is set to UTC, + # pytz.timezone.utcoffset() breaks when given the + # arg `is_dst` + pass entry = Entry.Entry(self, date, text=dict_entry['Entry Text'], starred=dict_entry["Starred"]) entry.uuid = dict_entry["UUID"] entry._tags = [self.config['tagsymbols'][0] + tag.lower() for tag in dict_entry.get("Tags", [])] |