[entropy.client] fixes for "dictionary changed size during iteration"
This commit is contained in:
@@ -2564,8 +2564,8 @@ class MaskableRepository(EntropyRepositoryBase):
|
||||
|
||||
# if we get here, it means we didn't find a match in repositories
|
||||
# so we scan packages, last chance
|
||||
for keyword in keyword_pkg.keys():
|
||||
# use .keys() because keyword_pkg gets modified during iteration
|
||||
for keyword in list(keyword_pkg.keys()):
|
||||
# use list() because keyword_pkg gets modified during iteration
|
||||
|
||||
# first of all check if keyword is in mykeywords
|
||||
if keyword not in mykeywords:
|
||||
|
||||
@@ -2855,7 +2855,8 @@ class CalculatorsMixin:
|
||||
change = False
|
||||
# now try to deeply remove unused packages
|
||||
# iterate over a copy
|
||||
for pkg_match in deep_dep_map.keys():
|
||||
# list() because the dict gets modified in setup_revdeps()
|
||||
for pkg_match in list(deep_dep_map.keys()):
|
||||
deep_dep_map[pkg_match] -= flat_dep_tree
|
||||
if (not deep_dep_map[pkg_match]) and \
|
||||
(pkg_match not in flat_dep_tree):
|
||||
|
||||
Reference in New Issue
Block a user