From f470f41d1dd954b60fbd0e54dea97596a1d10662 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 6 Nov 2014 22:10:45 -0800 Subject: [PATCH] ssoma-mda: Support UTC dates For example: >>> datetime = email.utils.parsedate_to_datetime('Tue, 21 Dec 2010 03:52:23 -0000') >>> datetime.utcoffset() is None True so without this case, we'll get: AttributeError: 'NoneType' object has no attribute 'seconds' --- ssoma-mda | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ssoma-mda b/ssoma-mda index 99d62b1..10b8d3d 100755 --- a/ssoma-mda +++ b/ssoma-mda @@ -225,7 +225,10 @@ def get_author(message): date = message['Date'] datetime = _email_utils.parsedate_to_datetime(date) time = int(datetime.timestamp()) - offset = datetime.utcoffset().seconds // 60 + if datetime.utcoffset(): + offset = datetime.utcoffset().seconds // 60 + else: + offset = 0 return _pygit2.Signature( name=author_name, email=author_email, -- 2.26.2