Author: andar

Revision: 5577

Log:
        Implement better version check when importing libtorrent -- account for 
minor version numbers

Diff:
Modified: trunk/deluge/_libtorrent.py
===================================================================
--- trunk/deluge/_libtorrent.py 2009-07-30 21:14:50 UTC (rev 5576)
+++ trunk/deluge/_libtorrent.py 2009-07-30 21:27:36 UTC (rev 5577)
@@ -44,9 +44,13 @@
 >>> 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)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to