The total_seconds function was added to datetime in python-2.7. For
compatibility with previous versions of python, use its suggested
equivalent (except drop microseconds, since we don't care about them in
this context).
Signed-off-by: Konstantin Ryabitsev <mricon@kernel.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
if patch.content:
body += '\n' + patch.content
- utc_timestamp = (patch.date -
- datetime.datetime.utcfromtimestamp(0)).total_seconds()
+ delta = patch.date - datetime.datetime.utcfromtimestamp(0)
+ utc_timestamp = delta.seconds + delta.days*24*3600
mail = PatchMbox(body)
mail['Subject'] = patch.name