summaryrefslogtreecommitdiffstats
path: root/deluge/_libtorrent.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 15:05:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 16:15:47 +0000
commitb686174b07bd56af4e5ffaa23c24f27f417fc305 (patch)
tree1ce335620d99341d94e88c159c0b9b0f6f0de5a0 /deluge/_libtorrent.py
parentAdding debian version 2.0.3-4. (diff)
downloaddeluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.tar.xz
deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.zip
Merging upstream version 2.1.1 (Closes: #1026291).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/_libtorrent.py')
-rw-r--r--deluge/_libtorrent.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/deluge/_libtorrent.py b/deluge/_libtorrent.py
index f155fee..642855c 100644
--- a/deluge/_libtorrent.py
+++ b/deluge/_libtorrent.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
@@ -15,19 +14,22 @@ Example:
>>> from deluge._libtorrent import lt
"""
-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'
+REQUIRED_VERSION = '1.2.0.0'
LT_VERSION = lt.__version__
if VersionSplit(LT_VERSION) < VersionSplit(REQUIRED_VERSION):
- raise ImportError(
- 'Deluge %s requires libtorrent >= %s' % (get_version(), REQUIRED_VERSION)
+ raise LibtorrentImportError(
+ f'Deluge {get_version()} requires libtorrent >= {REQUIRED_VERSION}'
)