Skip to content

Commit

Permalink
remove all usage of six
Browse files Browse the repository at this point in the history
  • Loading branch information
salilmishra23 committed Sep 9, 2022
1 parent 755597f commit 2b038a3
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 25 deletions.
4 changes: 2 additions & 2 deletions mozdownload/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import re

import requests
from six.moves.html_parser import HTMLParser
from six.moves.urllib.parse import unquote
from html.parser import HTMLParser
from urllib.parse import unquote


class DirectoryParser(HTMLParser):
Expand Down
2 changes: 1 addition & 1 deletion mozdownload/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import progressbar as pb
import redo
import requests
from six.moves.urllib.parse import quote, urlparse
from urllib.parse import quote, urlparse

from mozdownload import errors
from mozdownload import treeherder
Expand Down
3 changes: 1 addition & 2 deletions mozdownload/treeherder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from __future__ import absolute_import, unicode_literals

import logging
import six

from thclient import TreeherderClient

Expand Down Expand Up @@ -73,7 +72,7 @@ def query_builds_by_revision(self, revision, job_type_name='Build', debug_build=

# Retrieve the option hash to filter for type of build (opt, and debug for now)
option_hash = None
for key, values in six.iteritems(self.client.get_option_collection_hash()):
for key, values in self.client.get_option_collection_hash().items():
for value in values:
if value['name'] == ('debug' if debug_build else 'opt'):
option_hash = key
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os

import pytest
from six.moves.urllib.parse import parse_qs, urlparse
from urllib.parse import parse_qs, urlparse

from wptserve import (
handlers,
Expand Down
2 changes: 1 addition & 1 deletion tests/daily_scraper/test_daily_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import DailyScraper
from mozdownload.utils import urljoin
Expand Down
7 changes: 1 addition & 6 deletions tests/directory_parser/test_directory_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import os

import six

from mozdownload.parser import DirectoryParser
from mozdownload.utils import urljoin

Expand Down Expand Up @@ -46,10 +44,7 @@ def test_filter(httpd):
parser.entries = parser.filter(r'^\d+$')

# Get only the subdirectories of the folder
if six.PY2:
dirs = os.walk(folder_path).next()[1]
elif six.PY3:
dirs = os.walk(folder_path).__next__()[1]
dirs = os.walk(folder_path).__next__()[1]
dirs.sort()
assert parser.entries == dirs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import ReleaseCandidateScraper
from mozdownload.utils import urljoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import ReleaseCandidateScraper
from mozdownload.utils import urljoin
Expand Down
2 changes: 1 addition & 1 deletion tests/release_scraper/test_release_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import ReleaseScraper
from mozdownload.utils import urljoin
Expand Down
2 changes: 1 addition & 1 deletion tests/release_scraper/test_release_scraper_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import ReleaseScraper
from mozdownload.utils import urljoin
Expand Down
2 changes: 1 addition & 1 deletion tests/remote/test_devedition.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""Test all scraper classes for Firefox Developer Edition against the remote server"""

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

import mozdownload
from mozdownload.scraper import BASE_URL
Expand Down
2 changes: 1 addition & 1 deletion tests/remote/test_firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""Test all scraper classes for Firefox against the remote server"""

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

import mozdownload
from mozdownload.scraper import BASE_URL
Expand Down
2 changes: 1 addition & 1 deletion tests/remote/test_thunderbird.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

import mozdownload
from mozdownload.scraper import BASE_URL
Expand Down
2 changes: 1 addition & 1 deletion tests/tinderbox_scraper/test_tinderbox_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import TinderboxScraper
from mozdownload.utils import urljoin
Expand Down
5 changes: 2 additions & 3 deletions tests/treeherder/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import re

import pytest
import six
from six.moves.urllib.parse import parse_qs, urlparse
from urllib.parse import parse_qs, urlparse
from wptserve.handlers import json_handler

from mozdownload.treeherder import Treeherder, PLATFORM_MAP
Expand All @@ -32,7 +31,7 @@ def handle_rest_api(request, response):
def do_filter(entry):
result = True

for option, values in six.iteritems(query_options):
for option, values in query_options.items():
# Don't handle options which are not properties of the entry
if option not in entry:
continue
Expand Down
2 changes: 1 addition & 1 deletion tests/try_scraper/test_try_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os

import pytest
from six.moves.urllib.parse import unquote
from urllib.parse import unquote

from mozdownload import TryScraper
from mozdownload.utils import urljoin
Expand Down

0 comments on commit 2b038a3

Please sign in to comment.