diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-01-27 15:37:17 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2017-01-27 15:37:17 -0800 |
commit | d56121e74a5abaf5d463983c9ebec0441ef50f38 (patch) | |
tree | cef634952e99920e6368433f63415228f6e45e03 /alot/helper.py | |
parent | 1529f00f98e9365c9b93994bad17d2d6bce80243 (diff) |
helper: Use __future__ division
Diffstat (limited to 'alot/helper.py')
-rw-r--r-- | alot/helper.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/alot/helper.py b/alot/helper.py index a60c9ea7..49f894ed 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -3,6 +3,7 @@ # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file from __future__ import absolute_import +from __future__ import division from datetime import timedelta from datetime import datetime @@ -238,9 +239,9 @@ def pretty_datetime(d): if delta.seconds < 60: string = 'just now' elif delta.seconds < 3600: - string = '%dmin ago' % (delta.seconds / 60) + string = '%dmin ago' % (delta.seconds // 60) elif delta.seconds < 6 * 3600: - string = '%dh ago' % (delta.seconds / 3600) + string = '%dh ago' % (delta.seconds // 3600) else: string = d.strftime(hourminfmt) elif d.date() == today - timedelta(1): @@ -523,7 +524,7 @@ def humanize_size(size): (1024, '%iK'), (1024 * 1024, '%.1fM')): if size / factor < 1024: - return format_string % (float(size) / factor) + return format_string % (size / factor) return format_string % (size / factor) |