summaryrefslogtreecommitdiffstats
path: root/deluge/_libtorrent.py
diff options
context:
space:
mode:
Diffstat (limited to 'deluge/_libtorrent.py')
-rw-r--r--deluge/_libtorrent.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/deluge/_libtorrent.py b/deluge/_libtorrent.py
index f155feedb..0020184e5 100644
--- a/deluge/_libtorrent.py
+++ b/deluge/_libtorrent.py
@@ -18,16 +18,21 @@ Example:
from __future__ import unicode_literals
from deluge.common import VersionSplit, get_version
+from deluge.error import LibtorrentImportError
try:
import deluge.libtorrent as lt
except ImportError:
- import libtorrent as lt
+ try:
+ import libtorrent as lt
+ except ImportError as ex:
+ raise LibtorrentImportError('No libtorrent library found: %s' % (ex))
+
REQUIRED_VERSION = '1.1.2.0'
LT_VERSION = lt.__version__
if VersionSplit(LT_VERSION) < VersionSplit(REQUIRED_VERSION):
- raise ImportError(
+ raise LibtorrentImportError(
'Deluge %s requires libtorrent >= %s' % (get_version(), REQUIRED_VERSION)
)