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'
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,