diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 339f1393f5..1e52350e46 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -97,8 +97,12 @@ class CoverCache(Thread): # {{{ import traceback traceback.print_exc() continue - with self.lock: - self.cache[id_] = img + try: + with self.lock: + self.cache[id_] = img + except: + # Happens during interpreter shutdown + break def set_cache(self, ids): with self.lock: