diff --git a/src/calibre/utils/config.py b/src/calibre/utils/config.py index 5be19df88a..924c1db9ac 100644 --- a/src/calibre/utils/config.py +++ b/src/calibre/utils/config.py @@ -363,25 +363,18 @@ class XMLConfig(dict): self.update(d) def __getitem__(self, key): - from polyglot.plistlib import unwrap_bytes try: - ans = dict.__getitem__(self, key) - return unwrap_bytes(ans) + return dict.__getitem__(self, key) except KeyError: return self.defaults.get(key, None) def get(self, key, default=None): - from polyglot.plistlib import unwrap_bytes try: - ans = dict.__getitem__(self, key) - return unwrap_bytes(ans) + return dict.__getitem__(self, key) except KeyError: return self.defaults.get(key, default) def __setitem__(self, key, val): - from polyglot.plistlib import wrap_bytes - if isinstance(val, bytes): - val = wrap_bytes(val) dict.__setitem__(self, key, val) self.commit() diff --git a/src/polyglot/plistlib.py b/src/polyglot/plistlib.py index e31b23f05f..e1a5b8b16a 100644 --- a/src/polyglot/plistlib.py +++ b/src/polyglot/plistlib.py @@ -2,11 +2,5 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2019, Kovid Goyal -def unwrap_bytes(x): - return x - -def wrap_bytes(x): - return x - from plistlib import loads, dumps, Data # noqa loads_binary_or_xml = loads