Raise ImportError and notify user when specifying a non existant converter graphics backend
This commit is contained in:
@@ -43,8 +43,11 @@ def _lazy_load(fn):
|
|||||||
@_lazy_load
|
@_lazy_load
|
||||||
def _get_backend():
|
def _get_backend():
|
||||||
return import_module(GRAPHICS_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):
|
def cleanup(filename):
|
||||||
''' tries to remove the given filename. Ignores non-existent files '''
|
''' tries to remove the given filename. Ignores non-existent files '''
|
||||||
|
|||||||
Reference in New Issue
Block a user