mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
plugin_err must always be a string
This commit is contained in:
parent
fe40196c06
commit
191ce078e7
@ -316,7 +316,7 @@ class Plugins(collections.Mapping):
|
|||||||
def __getitem__(self, name):
|
def __getitem__(self, name):
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
try:
|
try:
|
||||||
return import_module('calibre_extensions.' + name), None
|
return import_module('calibre_extensions.' + name), ''
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
raise KeyError('No plugin named %r'%name)
|
raise KeyError('No plugin named %r'%name)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
@ -114,7 +114,7 @@ class BuildTest(unittest.TestCase):
|
|||||||
ctypes.CDLL(os.path.join(plugins_loc, name + ('.dylib' if ismacos else '.so')))
|
ctypes.CDLL(os.path.join(plugins_loc, name + ('.dylib' if ismacos else '.so')))
|
||||||
continue
|
continue
|
||||||
mod, err = plugins[name]
|
mod, err = plugins[name]
|
||||||
self.assertFalse(err or not mod, 'Failed to load plugin: ' + name + ' with error:\n' + err)
|
self.assertTrue(mod, f'Failed to load plugin: {name} with error: {err}')
|
||||||
|
|
||||||
def test_lxml(self):
|
def test_lxml(self):
|
||||||
from calibre.utils.cleantext import test_clean_xml_chars
|
from calibre.utils.cleantext import test_clean_xml_chars
|
||||||
|
Loading…
x
Reference in New Issue
Block a user