From b237875ecc9221b45e1a751ec148dfbbdc39b74e Mon Sep 17 00:00:00 2001 From: P0psicles Date: Sun, 12 Apr 2020 09:39:33 +0200 Subject: [PATCH] Fix size changed during iteration. `dict.values()` is a generator. So it can cause errors when the dict is changed during iteration. Prevent this by casting to an array, before iterating. Most py2 backwards compatible solution. --- medusa/scene_exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/medusa/scene_exceptions.py b/medusa/scene_exceptions.py index 8815236a25..db44858f5a 100644 --- a/medusa/scene_exceptions.py +++ b/medusa/scene_exceptions.py @@ -161,8 +161,8 @@ def get_scene_exceptions_by_name(show_name): """Get the series_id, season and indexer of the scene exception.""" # Flatten the exceptions_cache. scene_exceptions = set() - for exception_set in exceptions_cache.values(): - for title_exception in exception_set.values(): + for exception_set in list(exceptions_cache.values()): + for title_exception in list(exception_set.values()): scene_exceptions.update(title_exception) matches = set()