From: W. Trevor King Date: Fri, 7 Nov 2014 06:10:45 +0000 (-0800) Subject: ssoma-mda: Support UTC dates X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f470f41d1dd954b60fbd0e54dea97596a1d10662;p=ssoma-mda.git 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' --- 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,