Handle exceptions in load_extensions
This will skip those extensions, instead of crashing mopidy, e.g. when mopidy-mopify fails because of a missing HOME environment variable during mopidy's tests. Ref: https://github.com/dirkgroenen/mopidy-mopify/issues/119
This commit is contained in:
parent
22b18a46d1
commit
ebb413b6b1
@ -198,7 +198,12 @@ def load_extensions():
|
|||||||
|
|
||||||
for entry_point in pkg_resources.iter_entry_points('mopidy.ext'):
|
for entry_point in pkg_resources.iter_entry_points('mopidy.ext'):
|
||||||
logger.debug('Loading entry point: %s', entry_point)
|
logger.debug('Loading entry point: %s', entry_point)
|
||||||
extension_class = entry_point.load(require=False)
|
try:
|
||||||
|
extension_class = entry_point.load(require=False)
|
||||||
|
except Exception as e:
|
||||||
|
logger.exception("Failed to load extension %s: %s" % (
|
||||||
|
entry_point.name, e))
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not issubclass(extension_class, Extension):
|
if not issubclass(extension_class, Extension):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user