ci,crnm: fix round error in pretty_duration
When a time delta is a float, the minutes and seconds can produce a weird output between 0.5 and 0.9 with strings like 1m60s. Just forcing a cast to an integer, the bug is solved. Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39134>
This commit is contained in:
parent
4384099bc2
commit
9864e9b70d
1 changed files with 2 additions and 1 deletions
|
|
@ -41,8 +41,9 @@ def print_once(*args, **kwargs):
|
|||
print(*args, **kwargs)
|
||||
|
||||
|
||||
def pretty_duration(seconds):
|
||||
def pretty_duration(seconds: int | float) -> str:
|
||||
"""Pretty print duration"""
|
||||
seconds = int(seconds)
|
||||
hours, rem = divmod(seconds, 3600)
|
||||
minutes, seconds = divmod(rem, 60)
|
||||
if hours:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue