diff options
author | Konstantin Ryabitsev <mricon@kernel.org> | 2013-06-13 10:50:56 -0400 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-06-16 16:54:07 +0800 |
commit | 3c9319711a8b4cc91016043f80129362ab438dfc (patch) | |
tree | 65b05ee5134b80e2d07c5e00a841170a55d3f176 /apps/patchwork/views | |
parent | 508510d29aa7b0aaf946f6565e8040f9895f84c8 (diff) | |
download | patchwork-3c9319711a8b4cc91016043f80129362ab438dfc.tar.bz2 patchwork-3c9319711a8b4cc91016043f80129362ab438dfc.tar.xz |
Don't use total_seconds for python < 2.7
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>
Diffstat (limited to 'apps/patchwork/views')
-rw-r--r-- | apps/patchwork/views/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/patchwork/views/__init__.py b/apps/patchwork/views/__init__.py index 681532a..a823388 100644 --- a/apps/patchwork/views/__init__.py +++ b/apps/patchwork/views/__init__.py @@ -190,8 +190,8 @@ def patch_to_mbox(patch): 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 |