helpers.format_timedelta: use timedelta.total_seconds()

This commit is contained in:
Marian Beermann 2016-08-06 22:41:24 +02:00
parent 389ca94407
commit bec5051ea5
1 changed files with 1 additions and 2 deletions

View File

@ -597,8 +597,7 @@ def format_time(t):
def format_timedelta(td):
"""Format timedelta in a human friendly format
"""
# Since td.total_seconds() requires python 2.7
ts = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6) / float(10 ** 6)
ts = td.total_seconds()
s = ts % 60
m = int(ts / 60) % 60
h = int(ts / 3600) % 24