1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Fix timedelta.in_seconds support in python 2.6

This commit is contained in:
sam 2012-05-22 20:11:38 +02:00
parent d12718d9dd
commit 6959fcbed9

View File

@ -233,7 +233,10 @@ class Paste(object):
In 3 minutes, or in 3 days or the 23/01/2102
"""
try:
expiration = (self.expiration - datetime.now()).total_seconds()
expiration = self.expiration - datetime.now()
# in_seconds doesn't exist in python 2.6
expiration = expiration.days * 24 * 60 * 60 + expiration.seconds
except TypeError:
return None