mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fix an attribute error that can be raised in humanize_timedelta if seconds = 0 (#3231)
* Migrate Playlist to DB 3 TODO 1 Migrate Config to Schema 3 without playlists and update get_playlist methods Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Revert "Migrate Playlist to DB 3 TODO 1 Migrate Config to Schema 3 without playlists and update get_playlist methods" This reverts commit 4af33cff Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Allow removing tracks from queue by URL Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Words matter Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * *sigh* Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * chore Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Fix an attribute error that can be raised here is seconds = 0 Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * Fix an attribute error that can be raised here is seconds = 0 Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * go away Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com> * *sigh* Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
parent
f9211ff50f
commit
f7e2617911
1
changelog.d/3231.bugfix.1.rst
Normal file
1
changelog.d/3231.bugfix.1.rst
Normal file
@ -0,0 +1 @@
|
||||
Fix an attribute error that can be raised in humanize_timedelta if seconds = 0.
|
||||
@ -430,7 +430,7 @@ def humanize_timedelta(
|
||||
"""
|
||||
|
||||
try:
|
||||
obj = seconds or timedelta.total_seconds()
|
||||
obj = seconds if seconds is not None else timedelta.total_seconds()
|
||||
except AttributeError:
|
||||
raise ValueError("You must provide either a timedelta or a number of seconds")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user