From c48269d7e7a578e0e836df49dca801978dd9fbe8 Mon Sep 17 00:00:00 2001 From: David Marx Date: Sat, 21 Apr 2018 13:01:53 -0700 Subject: [PATCH] Fixed utc offset bug for issue #8 --- psaw/PushshiftAPI.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/psaw/PushshiftAPI.py b/psaw/PushshiftAPI.py index 2202a1d..3cd4212 100644 --- a/psaw/PushshiftAPI.py +++ b/psaw/PushshiftAPI.py @@ -30,7 +30,10 @@ class PushshiftAPIMinimal(object): @property def utc_offset_secs(self): if not self._utc_offset_secs: - self._utc_offset_secs = dt.utcnow().astimezone().utcoffset().total_seconds() + try: + self._utc_offset_secs = dt.utcnow().astimezone().utcoffset().total_seconds() + except ValueError: + self._utc_offset_secs = 0 return self._utc_offset_secs def _limited(self, payload):