@@ -130,6 +130,8 @@ def _humanize_time(amount: int, unit: str, short_label: bool = False):
130
130
--------
131
131
>>> _humanize_time(173, "hours")
132
132
[(7, 'days'), (5, 'hours')]
133
+ >>> _humanize_time(173.345, "seconds")
134
+ [(2, 'minutes'), (53, 'seconds')]
133
135
>>> _humanize_time(173, "hours", short_label=True)
134
136
[(7, 'd'), (5, 'h')]
135
137
>>> _humanize_time(0, "seconds", short_label=True)
@@ -153,7 +155,7 @@ def _humanize_time(amount: int, unit: str, short_label: bool = False):
153
155
result = []
154
156
remaining_seconds = seconds
155
157
for entry in _TIME_UNITS :
156
- whole_units = remaining_seconds // entry ["in_seconds" ]
158
+ whole_units = int ( remaining_seconds / entry ["in_seconds" ])
157
159
if whole_units >= 1 :
158
160
if short_label :
159
161
label = entry ["short" ]
@@ -166,7 +168,7 @@ def _humanize_time(amount: int, unit: str, short_label: bool = False):
166
168
result .append ((whole_units , label ))
167
169
remaining_seconds -= whole_units * entry ["in_seconds" ]
168
170
else :
169
- result .append ((remaining_seconds , label ))
171
+ result .append ((int ( remaining_seconds ) , label ))
170
172
171
173
if not result :
172
174
result .append (
0 commit comments