Check that offset exists

This commit is contained in:
bashrc committed 2020-11-22 20:37:08 +00:00
1 parent 758380dade
commit a998c0b321
1 file changed
+2 -1
+2 -1
View File
@@ -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)