From 91e81f6931ed5cf8917b2bbb23a0033478c0dd89 Mon Sep 17 00:00:00 2001 From: s3lph <1375407-s3lph@users.noreply.gitlab.com> Date: Sat, 20 Aug 2022 12:24:59 +0200 Subject: [PATCH] Make mypy happy --- multischleuder/processor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/multischleuder/processor.py b/multischleuder/processor.py index a9eb2a2..a42ef5d 100644 --- a/multischleuder/processor.py +++ b/multischleuder/processor.py @@ -98,11 +98,14 @@ class MultiList: continue new_subs.add(s) # Compare the key blobs to the ones present before this run - unchanged_subs = {s for s in new_subs if s.key.blob in {o.key.blob for o in current_subs if o.key is not None}} + old_keys = {s.key.blob for s in current_subs if s.key is not None} + unchanged_subs = {s for s in new_subs if s.key is not None and s.key.blob in old_keys} + unchanged_fprs = {s.key.fingerprint for s in unchanged_subs if s.key is not None} # Remove the unchanged keys from the changesets so that they are not included in the admin report to_subscribe = {s for s in to_subscribe if s not in unchanged_subs} to_update = {s for s in to_update if s not in unchanged_subs} - to_add = {k for k in to_add if k.fingerprint not in {s.key.fingerprint for s in unchanged_subs}} + # need to compare by fpr because == includes the (potentially different) blob + to_add = {k for k in to_add if k.fingerprint not in unchanged_fprs} if len(to_add) + len(to_subscribe) + len(to_unsubscribe) + len(to_remove) == 0: logging.info(f'No changes for {self._target}')