diff --git a/deluge/core/alertmanager.py b/deluge/core/alertmanager.py index dddb73a5e..4019646b8 100644 --- a/deluge/core/alertmanager.py +++ b/deluge/core/alertmanager.py @@ -28,7 +28,13 @@ import gobject import deluge.component as component -import deluge.libtorrent as lt +try: + import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + from deluge.log import LOG as log class AlertManager(component.Component): diff --git a/deluge/core/autoadd.py b/deluge/core/autoadd.py index 60e7a3559..8c38bd3d9 100644 --- a/deluge/core/autoadd.py +++ b/deluge/core/autoadd.py @@ -26,9 +26,12 @@ import os try: - import libtorrent as lt -except ImportError: import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + import deluge.component as component from deluge.configmanager import ConfigManager from deluge.log import LOG as log diff --git a/deluge/core/core.py b/deluge/core/core.py index a1d3896bc..0f501310c 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -40,9 +40,12 @@ import threading import socket try: - import libtorrent as lt -except ImportError: import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + import deluge.configmanager import deluge.common import deluge.component as component diff --git a/deluge/core/oldstateupgrader.py b/deluge/core/oldstateupgrader.py index 65afecd0b..12342b475 100644 --- a/deluge/core/oldstateupgrader.py +++ b/deluge/core/oldstateupgrader.py @@ -30,9 +30,12 @@ import cPickle import shutil try: - import libtorrent as lt -except ImportError: import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + from deluge.configmanager import ConfigManager import deluge.core.torrentmanager from deluge.log import LOG as log diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index 90780bc64..bd7885c49 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -28,9 +28,12 @@ import threading import gobject try: - import libtorrent as lt -except ImportError: import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + import deluge.configmanager import deluge.common import deluge.component as component diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py index 7f94ac3d9..8114b643e 100644 --- a/deluge/core/torrent.py +++ b/deluge/core/torrent.py @@ -30,9 +30,12 @@ import time from urlparse import urlparse try: - import libtorrent as lt -except ImportError: import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + import deluge.common import deluge.component as component from deluge.configmanager import ConfigManager diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index e2ad3234b..c03c6cd99 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -34,9 +34,12 @@ import shutil import gobject try: - import libtorrent as lt -except ImportError: import deluge.libtorrent as lt +except ImportError: + import libtorrent as lt + if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14): + raise ImportError("This version of Deluge requires libtorrent 0.14!") + import deluge.common import deluge.component as component