From f07c0d98948d93622b389ca0ec2741581568b7e0 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 30 Jul 2009 21:27:36 +0000 Subject: [PATCH] Implement better version check when importing libtorrent -- account for minor version numbers --- deluge/_libtorrent.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deluge/_libtorrent.py b/deluge/_libtorrent.py index 095206726..34c2ea5ae 100644 --- a/deluge/_libtorrent.py +++ b/deluge/_libtorrent.py @@ -44,9 +44,13 @@ supports. >>> from deluge._libtorrent import lt """ + +REQUIRED_VERSION = "0.14.5.0" + try: import deluge.libtorrent as lt except ImportError: import libtorrent as lt - if not (lt.version_major == 0 and lt.version_minor == 14): - raise ImportError("This version of Deluge requires libtorrent 0.14!") + from deluge.common import VersionSplit + if VersionSplit(lt.version) < VersionSplit(REQUIRED_VERSION): + raise ImportError("This version of Deluge requires libtorrent >=%s!" % REQUIRED_VERSION)