Skip to content

Commit

Permalink
Fix util.plural_s for zero and negative (#14411)
Browse files Browse the repository at this point in the history
While this doesn't currently appear anywhere in usages, it would be
incorrect to say `0 error found` or `-4 line earlier`
  • Loading branch information
KotlinIsland authored Jan 9, 2023
1 parent 98cc165 commit 7efe8e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def time_spent_us(t0: int) -> int:

def plural_s(s: int | Sized) -> str:
count = s if isinstance(s, int) else len(s)
if count > 1:
if count != 1:
return "s"
else:
return ""

0 comments on commit 7efe8e5

Please sign in to comment.