From 6b13eeeb382cead4fec652a985e60c43e47d4b53 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 29 Sep 2009 09:24:16 +0000 Subject: [PATCH] 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) --- deluge/_libtorrent.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deluge/_libtorrent.py b/deluge/_libtorrent.py index 34c2ea5ae..8c0363b78 100644 --- a/deluge/_libtorrent.py +++ b/deluge/_libtorrent.py @@ -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) \ No newline at end of file