diff options
| author | 2023-02-19 16:05:49 +0100 | |
|---|---|---|
| committer | 2023-02-19 16:05:49 +0100 | |
| commit | d395bd510fa4f4376dc5237ab2f8d190a920d35d (patch) | |
| tree | 3e3b16b44064938be801aede14381562bae14f6a /deluge/_libtorrent.py | |
| parent | d1772d410235592b482e3b08b1863f6624d9fe6b (diff) | |
Adding upstream version 2.1.1.upstream/2.1.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/_libtorrent.py')
| -rw-r--r-- | deluge/_libtorrent.py | 16 |
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}' ) |
