diff --git a/modules/piratebay/test.py b/modules/piratebay/test.py index 7e966bf8b0622e78160a1f982ec4ead1a4971951..e31cb35740ea260f67e811336f4b606ab9fa2641 100644 --- a/modules/piratebay/test.py +++ b/modules/piratebay/test.py @@ -17,20 +17,21 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from weboob.tools.test import BackendTest -from weboob.capabilities.torrent import MagnetOnly - from random import choice +from weboob.capabilities.torrent import MagnetOnly +from weboob.tools.compat import basestring +from weboob.tools.test import BackendTest + class PiratebayTest(BackendTest): MODULE = 'piratebay' def test_torrent(self): # try something popular so we sometimes get a magnet-only torrent - l = list(self.backend.iter_torrents('ubuntu linux')) - if len(l): - torrent = choice(l) + torrents = list(self.backend.iter_torrents('ubuntu linux')) + if len(torrents): + torrent = choice(torrents) full_torrent = self.backend.get_torrent(torrent.id) assert torrent.name assert full_torrent.name == torrent.name diff --git a/tools/py3-compatible.modules b/tools/py3-compatible.modules index e606a8fb60c1f249948c84764b412be7ad277fd9..1482aac3c577c61bcda16b0af0b191a0bebb7437 100644 --- a/tools/py3-compatible.modules +++ b/tools/py3-compatible.modules @@ -108,8 +108,9 @@ pap pariskiwi paroles2chansons parolesmania -pastebin pastealacon +pastebin +piratebay pixtoilelibre podnapisi popolemploi