From 4c64beada22fd384cb3ea85c9ab9f372c15a5481 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Fri, 23 Sep 2011 19:00:58 -0400 Subject: [PATCH] fix rounding in lastfm module caused by python3 upgrade --- modules/lastfm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/lastfm.py b/modules/lastfm.py index d4a34d8..e59f9c7 100644 --- a/modules/lastfm.py +++ b/modules/lastfm.py @@ -279,20 +279,20 @@ def pretty_date(time=False): if second_diff < 120: return "a minute ago" if second_diff < 3600: - return str( second_diff / 60 ) + " minutes ago" + return str( second_diff // 60 ) + " minutes ago" if second_diff < 7200: return "an hour ago" if second_diff < 86400: - return str( second_diff / 3600 ) + " hours ago" + return str( second_diff // 3600 ) + " hours ago" if day_diff == 1: return "Yesterday" if day_diff < 7: return str(day_diff) + " days ago" if day_diff < 31: - return str(day_diff/7) + " weeks ago" + return str(day_diff // 7) + " weeks ago" if day_diff < 365: - return str(day_diff/30) + " months ago" - return str(day_diff/365) + " years ago" + return str(day_diff // 30) + " months ago" + return str(day_diff // 365) + " years ago" if __name__ == '__main__': print(__doc__.strip())