Use calibre plugin-loading error code correctly.

This commit is contained in:
Marshall T. Vandegrift 2008-12-20 16:42:05 -05:00
parent 18203fe159
commit 09c5eb6a16

View File

@ -8,10 +8,14 @@ __copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
import sys import sys
from calibre import plugins from calibre import plugins
_lzx, LZXError = plugins['lzx']
_lzx, _error = plugins['lzx']
if _lzx is None:
raise RuntimeError('Failed to load the lzx plugin: %s' % _error)
__all__ = ['Compressor', 'Decompressor', 'LZXError'] __all__ = ['Compressor', 'Decompressor', 'LZXError']
LZXError = _lzx.LZXError
Compressor = _lzx.Compressor Compressor = _lzx.Compressor
class Decompressor(object): class Decompressor(object):