Skip to content

Commit 723efca

Browse files
committed
made ruff happy without breaking the code
1 parent 4850596 commit 723efca

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

python_utils/formatters.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ def timesince(
161161

162162
output: types.List[str] = []
163163
for period, singular, plural in periods:
164-
if int(period):
165-
if int(period) == 1:
166-
output.append(f'{period:d} {singular}')
167-
else:
168-
output.append(f'{period:d} {plural}')
164+
int_period = int(period)
165+
if int_period == 1:
166+
output.append(f'{int_period} {singular}')
167+
elif int_period:
168+
output.append(f'{int_period} {plural}')
169169

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

0 commit comments

Comments
 (0)