summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <mricon@kernel.org>2013-06-13 10:50:56 -0400
committerJeremy Kerr <jk@ozlabs.org>2013-06-16 16:54:07 +0800
commit3c9319711a8b4cc91016043f80129362ab438dfc (patch)
tree65b05ee5134b80e2d07c5e00a841170a55d3f176 /apps
parent508510d29aa7b0aaf946f6565e8040f9895f84c8 (diff)
downloadpatchwork-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')
-rw-r--r--apps/patchwork/views/__init__.py4
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