change the _libtorrent module so that the included libtorrent is checked for the correct version also (incase people have been following svn and the version requirement changes)

This commit is contained in:
Damien Churchill 2009-09-29 09:24:16 +00:00
parent 9fafa31afe
commit 6b13eeeb38
1 changed files with 8 additions and 4 deletions

View File

@ -47,10 +47,14 @@ supports.
REQUIRED_VERSION = "0.14.5.0"
try:
import deluge.libtorrent as lt
except ImportError:
import libtorrent as lt
def check_version(LT):
from deluge.common import VersionSplit
if VersionSplit(lt.version) < VersionSplit(REQUIRED_VERSION):
raise ImportError("This version of Deluge requires libtorrent >=%s!" % REQUIRED_VERSION)
try:
import deluge.libtorrent as lt
check_version(lt)
except ImportError:
import libtorrent as lt
check_version(lt)