diff options
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}' ) |