Skip to content

Commit

Permalink
Discard instead of remove members of only_once_messages
Browse files Browse the repository at this point in the history
Prior to this commit, messages would sometimes not be present in
only_once_messages, causing an error. This uses the discard method which
won't error if the message isn't present.
  • Loading branch information
seddonym committed Dec 19, 2023
1 parent 7e61402 commit e9f5c1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mypy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def clear_errors_in_targets(self, path: str, targets: set[str]) -> None:
new_errors.append(info)
has_blocker |= info.blocker
elif info.only_once:
self.only_once_messages.remove(info.message)
self.only_once_messages.discard(info.message)
self.error_info_map[path] = new_errors
if not has_blocker and path in self.has_blockers:
self.has_blockers.remove(path)
Expand Down

0 comments on commit e9f5c1a

Please sign in to comment.