Skip to content

Commit

Permalink
Ensure get never returns None
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jun 9, 2024
1 parent ff22a18 commit 3fffab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netkan/netkan/download_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def commit_counts(self) -> None:
@staticmethod
def _download_summary_table(counts: Dict[str, int], how_many: int) -> str:
return '\n'.join(f' {counts[ident]:8} {ident}'
for ident in heapq.nlargest(how_many, counts, lambda i: counts.get(i))
for ident in heapq.nlargest(how_many, counts, lambda i: counts.get(i, 0))
if counts[ident] > 0)

def log_top(self, how_many: int) -> None:
Expand Down

0 comments on commit 3fffab5

Please sign in to comment.