Browse Source

helpers.format_timedelta: use timedelta.total_seconds()

Marian Beermann 9 years ago
parent
commit
bec5051ea5
1 changed files with 1 additions and 2 deletions
  1. 1 2
      src/borg/helpers.py

+ 1 - 2
src/borg/helpers.py

@@ -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