Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 1 addition & 7 deletions arrow/locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -2900,14 +2900,8 @@ def _format_timeframe(self, timeframe: TimeFrameLiteral, delta: int) -> str:
if isinstance(form, Mapping):
if delta < 0:
form = form["past"]
elif delta > 0:
form = form["future"]
else:
raise ValueError(
"Icelandic Locale does not support units with a delta of zero. "
"Please consider making a contribution to fix this issue."
)
# FIXME: handle when delta is 0
form = form["future"]

return form.format(abs(delta))

Expand Down
3 changes: 1 addition & 2 deletions tests/test_locales.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,7 @@ def test_format_timeframe(self):
assert self.locale._format_timeframe("years", -2) == "2 árum"
assert self.locale._format_timeframe("years", 2) == "2 ár"

with pytest.raises(ValueError):
self.locale._format_timeframe("years", 0)
assert self.locale._format_timeframe("years", 0) == "0 ár"


@pytest.mark.usefixtures("lang_locale")
Expand Down
Loading