diff --git a/src/calibre/db/legacy.py b/src/calibre/db/legacy.py index ebfe6b7199..359d368ab6 100644 --- a/src/calibre/db/legacy.py +++ b/src/calibre/db/legacy.py @@ -7,6 +7,7 @@ __copyright__ = '2013, Kovid Goyal ' import os, traceback, weakref from polyglot.builtins import iteritems, zip +from collections.abc import MutableMapping from calibre import force_unicode, isbytestring from calibre.constants import preferred_encoding @@ -52,7 +53,7 @@ def set_global_state(db): set_saved_searches(db, 'saved_searches') -class ThreadSafePrefs: +class ThreadSafePrefs(MutableMapping): def __init__(self, db): self.db = weakref.ref(db) diff --git a/src/calibre/db/tests/legacy.py b/src/calibre/db/tests/legacy.py index bf71f715e0..af95b0ea76 100644 --- a/src/calibre/db/tests/legacy.py +++ b/src/calibre/db/tests/legacy.py @@ -189,7 +189,7 @@ class LegacyTest(BaseTest): db = self.init_old() newstag = ndb.new_api.get_item_id('tags', 'news') - self.assertEqual(dict(db.prefs), ndb.prefs.copy()) + self.assertEqual(dict(db.prefs), dict(ndb.prefs)) for meth, args in iteritems({ 'find_identical_books': [(Metadata('title one', ['author one']),), (Metadata('unknown'),), (Metadata('xxxx'),)],