From ff9173ac297169ffd5645b596835cbba6cb93d2c Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 31 Mar 2011 23:57:24 -0400 Subject: [PATCH] Raise ImportError and notify user when specifying a non existant converter graphics backend --- apps/converter/api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/converter/api.py b/apps/converter/api.py index 4347bae6f6..5b72b4a043 100644 --- a/apps/converter/api.py +++ b/apps/converter/api.py @@ -43,8 +43,11 @@ def _lazy_load(fn): @_lazy_load def _get_backend(): return import_module(GRAPHICS_BACKEND) - -backend = _get_backend() + +try: + backend = _get_backend() +except ImportError: + raise ImportError('Missing or incorrect converter backend: %s' % GRAPHICS_BACKEND) def cleanup(filename): ''' tries to remove the given filename. Ignores non-existent files '''