Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/humanize/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ def naturaldelta(
converted to int (cannot be float due to 'inf' or 'nan').
In that case, a `value` is returned unchanged.

Raises:
OverflowError: If `value` is too large to convert to datetime.timedelta.

Examples:
Compare two timestamps in a custom local timezone::

Expand Down Expand Up @@ -151,7 +148,7 @@ def naturaldelta(
int(value) # Explicitly don't support string such as "NaN" or "inf"
value = float(value)
delta = dt.timedelta(seconds=value)
except (ValueError, TypeError):
except (ValueError, TypeError, OverflowError):
return str(value)

use_months = months
Expand Down