@@ -130,6 +130,8 @@ def _humanize_time(amount: int, unit: str, short_label: bool = False):
130130 --------
131131 >>> _humanize_time(173, "hours")
132132 [(7, 'days'), (5, 'hours')]
133+ >>> _humanize_time(173.345, "seconds")
134+ [(2, 'minutes'), (53, 'seconds')]
133135 >>> _humanize_time(173, "hours", short_label=True)
134136 [(7, 'd'), (5, 'h')]
135137 >>> _humanize_time(0, "seconds", short_label=True)
@@ -153,7 +155,7 @@ def _humanize_time(amount: int, unit: str, short_label: bool = False):
153155 result = []
154156 remaining_seconds = seconds
155157 for entry in _TIME_UNITS :
156- whole_units = remaining_seconds // entry ["in_seconds" ]
158+ whole_units = int ( remaining_seconds / entry ["in_seconds" ])
157159 if whole_units >= 1 :
158160 if short_label :
159161 label = entry ["short" ]
@@ -166,7 +168,7 @@ def _humanize_time(amount: int, unit: str, short_label: bool = False):
166168 result .append ((whole_units , label ))
167169 remaining_seconds -= whole_units * entry ["in_seconds" ]
168170 else :
169- result .append ((remaining_seconds , label ))
171+ result .append ((int ( remaining_seconds ) , label ))
170172
171173 if not result :
172174 result .append (
0 commit comments