From 06818b284d566aecb16b635b781f2e8b522392bb Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 8 Nov 2012 22:50:35 +0100 Subject: [PATCH] http: Don't crash if cherrypy is missing --- mopidy/frontends/cherrypyhttp.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mopidy/frontends/cherrypyhttp.py b/mopidy/frontends/cherrypyhttp.py index 453731fd..1eaf4b90 100644 --- a/mopidy/frontends/cherrypyhttp.py +++ b/mopidy/frontends/cherrypyhttp.py @@ -2,9 +2,15 @@ from __future__ import absolute_import import logging -import cherrypy import pykka +from mopidy import exceptions + +try: + import cherrypy +except ImportError as import_error: + raise exceptions.OptionalDependencyError(import_error) + logger = logging.getLogger('mopidy.frontends.cherrypyhttp')