From 753cce269738e93f36136f7daaf62bf1d10c1f87 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 21 Jan 2021 13:50:36 +0100 Subject: [PATCH] cache.py: Avoid dict changed size during iteration Subset of #4330 This code is ___only used in testing___ but it raises a RuntimeError on Apple Silicon M1 Macs. See #4330 Screenshots, problem 4 for details. --- openlibrary/core/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlibrary/core/cache.py b/openlibrary/core/cache.py index 25636542ffa..5639ede812d 100644 --- a/openlibrary/core/cache.py +++ b/openlibrary/core/cache.py @@ -157,7 +157,7 @@ def join_threads(self): Used only in testing. """ - for name, thread in self.active_threads.items(): + for name, thread in list(self.active_threads.items()): thread.join() def encode_args(self, args, kw=None):