diff --git a/src/calibre/constants.py b/src/calibre/constants.py index cff793cd1c..e5781fe5b3 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -203,12 +203,13 @@ class Plugins(collections.Mapping): del sys.modules[name] except KeyError: pass + plugin_err = u'' try: - p, err = importlib.import_module(name), '' + p = importlib.import_module(name) except Exception as err: p = None - err = str(err) - self._plugins[name] = (p, err) + plugin_err = unicode_type(err) + self._plugins[name] = p, plugin_err sys.path.remove(sys.extensions_location) def __iter__(self):