From cbb849568e54f66a1525ff604a291d9c185c4371 Mon Sep 17 00:00:00 2001 From: Vincent A Date: Mon, 9 Sep 2019 23:50:16 +0200 Subject: [PATCH] python3: avoid urllib in modules Ok, splitquery is not equivalent to partition, but i'm lazy now. --- modules/cpasbien/test.py | 3 +-- modules/kickass/test.py | 3 +-- modules/t411/test.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/cpasbien/test.py b/modules/cpasbien/test.py index 5141f2cf71..e343485b4e 100644 --- a/modules/cpasbien/test.py +++ b/modules/cpasbien/test.py @@ -20,7 +20,6 @@ from weboob.tools.test import BackendTest from weboob.capabilities.base import NotLoaded -import urllib from random import choice @@ -30,7 +29,7 @@ class CpasbienTest(BackendTest): def test_torrent(self): torrents = list(self.backend.iter_torrents('spiderman')) for torrent in torrents: - path, qs = urllib.splitquery(torrent.url) + path, _, qs = torrent.url.partition('?') assert path.endswith('.torrent') if qs: assert torrent.filename diff --git a/modules/kickass/test.py b/modules/kickass/test.py index 53c126dc15..949431a367 100644 --- a/modules/kickass/test.py +++ b/modules/kickass/test.py @@ -20,7 +20,6 @@ from weboob.tools.test import BackendTest from weboob.capabilities.base import NotLoaded -import urllib from random import choice @@ -30,7 +29,7 @@ class KickassTest(BackendTest): def test_torrent(self): torrents = list(self.backend.iter_torrents('debian')) for torrent in torrents: - path, qs = urllib.splitquery(torrent.url) + path, _, qs = torrent.url.partition('?') assert path.endswith('.torrent') if qs: assert torrent.filename diff --git a/modules/t411/test.py b/modules/t411/test.py index ef4785c885..9a12374f12 100644 --- a/modules/t411/test.py +++ b/modules/t411/test.py @@ -20,7 +20,6 @@ from weboob.tools.test import BackendTest from weboob.capabilities.base import NotLoaded -import urllib from random import choice @@ -30,7 +29,7 @@ class T411Test(BackendTest): def test_torrent(self): torrents = list(self.backend.iter_torrents('spiderman'))[:10] for torrent in torrents: - path, qs = urllib.splitquery(torrent.url) + path, _, qs = torrent.url.partition('?') assert torrent.id assert path.endswith(torrent.name) assert torrent.name -- GitLab