mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
Implement better version check when importing libtorrent -- account for minor version numbers
This commit is contained in:
parent
d685b2ddd6
commit
f07c0d9894
1 changed files with 6 additions and 2 deletions
|
@ -44,9 +44,13 @@ supports.
|
||||||
>>> from deluge._libtorrent import lt
|
>>> from deluge._libtorrent import lt
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
REQUIRED_VERSION = "0.14.5.0"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import libtorrent as lt
|
import libtorrent as lt
|
||||||
if not (lt.version_major == 0 and lt.version_minor == 14):
|
from deluge.common import VersionSplit
|
||||||
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
if VersionSplit(lt.version) < VersionSplit(REQUIRED_VERSION):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent >=%s!" % REQUIRED_VERSION)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue