From a998c0b3213f3493da365e5212c739569335fbd0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 22 Nov 2020 20:37:08 +0000 Subject: [PATCH] Check that offset exists --- newswire.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newswire.py b/newswire.py index 4c86ac597..2e0ab8aaf 100644 --- a/newswire.py +++ b/newswire.py @@ -191,7 +191,8 @@ def parseFeedDate(pubDate: str) -> str: pubDateStr = None if publishedDate: offset = publishedDate.utcoffset() - publishedDate = publishedDate - offset + if offset: + publishedDate = publishedDate - offset # convert local date to UTC publishedDate = publishedDate.replace(tzinfo=timezone.utc) pubDateStr = str(publishedDate)