source of highlighter
plain | download
    1 From 08fac7cbffa4488729cfe53bbbbb6348047e8338 Mon Sep 17 00:00:00 2001
    2 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
    3 Date: Sun, 18 Sep 2022 13:35:09 +0200
    4 Subject: [PATCH 1/2] checksum.py: Remove can't be called during iteration
    5 MIME-Version: 1.0
    6 Content-Type: text/plain; charset=UTF-8
    7 Content-Transfer-Encoding: 8bit
    8 
    9 We get
   10   RuntimeError: Set changed size during iteration
   11 if we call .remove() during set iteration.
   12 
   13 This can be simply fixed by copying the set.
   14 
   15 Signed-off-by: Marek BehĂșn <kabel@kernel.org>
   16 ---
   17  lib/portage/checksum.py | 2 +-
   18  1 file changed, 1 insertion(+), 1 deletion(-)
   19 
   20 diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py
   21 index 03a963a3e..fdf9bc4d0 100644
   22 --- a/lib/portage/checksum.py
   23 +++ b/lib/portage/checksum.py
   24 @@ -445,7 +445,7 @@ def _apply_hash_filter(digests, hash_filter):
   25      modified = False
   26      if len(verifiable_hash_types) > 1:
   27          verifiable_hash_types.discard("size")
   28 -        for k in verifiable_hash_types:
   29 +        for k in verifiable_hash_types.copy():
   30              if not hash_filter(k):
   31                  modified = True
   32                  verifiable_hash_types.remove(k)
   33 -- 
   34 2.35.1
   35