Skip to content

Commit

Permalink
made ruff happy without breaking the code
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Nov 26, 2024
1 parent 4850596 commit 723efca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python_utils/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ def timesince(

output: types.List[str] = []
for period, singular, plural in periods:
if int(period):
if int(period) == 1:
output.append(f'{period:d} {singular}')
else:
output.append(f'{period:d} {plural}')
int_period = int(period)
if int_period == 1:
output.append(f'{int_period} {singular}')
elif int_period:
output.append(f'{int_period} {plural}')

if output:
return f'{" and ".join(output[:2])} ago'
Expand Down

0 comments on commit 723efca

Please sign in to comment.