aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-04-10 12:47:39 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-04-10 12:47:39 +0200
commite9942bddb0dd3ae67403e3ca486bea2e0f4ce954 (patch)
tree5e202204d4948d7cfd8165e5207657ac3a09c8ba /python/servo
parent53218621e934f5cb66681b22d3d91c3bbcb0d4bc (diff)
downloadservo-e9942bddb0dd3ae67403e3ca486bea2e0f4ce954.tar.gz
servo-e9942bddb0dd3ae67403e3ca486bea2e0f4ce954.zip
Replace usage of six.moves.urllib with urllib
Also organize some of the imports. Now that Servo only uses Python 3, this module is unnecessary. This is part of the gradual migration to using only Python 3.
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/bootstrap.py2
-rw-r--r--python/servo/bootstrap_commands.py4
-rw-r--r--python/servo/build_commands.py4
-rw-r--r--python/servo/command_base.py29
-rw-r--r--python/servo/devenv_commands.py6
-rw-r--r--python/servo/package_commands.py2
-rw-r--r--python/servo/util.py6
7 files changed, 27 insertions, 26 deletions
diff --git a/python/servo/bootstrap.py b/python/servo/bootstrap.py
index c83adc24897..1acef6e3d72 100644
--- a/python/servo/bootstrap.py
+++ b/python/servo/bootstrap.py
@@ -10,7 +10,7 @@ import os
import distro
import subprocess
import six
-import six.moves.urllib as urllib
+import urllib
from subprocess import PIPE
from zipfile import BadZipfile
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py
index 904f5da109e..aac03c8d645 100644
--- a/python/servo/bootstrap_commands.py
+++ b/python/servo/bootstrap_commands.py
@@ -10,6 +10,7 @@
from __future__ import absolute_import, print_function, unicode_literals
import base64
+import glob
import json
import os
import os.path as path
@@ -18,8 +19,7 @@ import re
import subprocess
import sys
import traceback
-import six.moves.urllib as urllib
-import glob
+import urllib
from mach.decorators import (
CommandArgument,
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index a3875e2c679..1a9ee339b1a 100644
--- a/python/servo/build_commands.py
+++ b/python/servo/build_commands.py
@@ -15,11 +15,11 @@ import os
import os.path as path
import platform
import shutil
+import stat
import subprocess
import sys
-import six.moves.urllib as urllib
+import urllib
import zipfile
-import stat
from time import time
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 7dafcd8c5db..d51e3f6bc8c 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -9,35 +9,36 @@
from __future__ import print_function
-from errno import ENOENT as NO_SUCH_FILE_OR_DIRECTORY
-from glob import glob
-import shutil
+import contextlib
+import distro
+import functools
import gzip
import itertools
+import json
import locale
import os
-from os import path
import platform
-import distro
import re
-import contextlib
-import subprocess
-from subprocess import PIPE
+import shutil
import six
+import subprocess
import sys
import tarfile
+import urllib
import zipfile
-import functools
+
+from errno import ENOENT as NO_SUCH_FILE_OR_DIRECTORY
+from glob import glob
+from os import path
+from subprocess import PIPE
+
+import toml
+
from xml.etree.ElementTree import XML
from servo.util import download_file
-import six.moves.urllib as urllib
from .bootstrap import check_gstreamer_lib
-
from mach.decorators import CommandArgument
from mach.registrar import Registrar
-import toml
-import json
-
from servo.packages import WINDOWS_MSVC as msvc_deps
from servo.util import host_triple
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index db44ad2121c..5570aae50b7 100644
--- a/python/servo/devenv_commands.py
+++ b/python/servo/devenv_commands.py
@@ -11,12 +11,12 @@ from __future__ import print_function, unicode_literals
from os import path, listdir, getcwd
from time import time
+import json
import signal
+import subprocess
import sys
import tempfile
-import six.moves.urllib as urllib
-import json
-import subprocess
+import urllib
from mach.decorators import (
CommandArgument,
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py
index df6e6443f6c..f6010c0d3a0 100644
--- a/python/servo/package_commands.py
+++ b/python/servo/package_commands.py
@@ -21,7 +21,7 @@ import shutil
import subprocess
import sys
import tempfile
-import six.moves.urllib as urllib
+import urllib
import xml
from mach.decorators import (
diff --git a/python/servo/util.py b/python/servo/util.py
index 84dd19e5208..c41cb1e1640 100644
--- a/python/servo/util.py
+++ b/python/servo/util.py
@@ -14,14 +14,14 @@ import os
import os.path
import platform
import shutil
-from socket import error as socket_error
import stat
-from io import BytesIO
import sys
import time
+import urllib
import zipfile
-import six.moves.urllib as urllib
+from io import BytesIO
+from socket import error as socket_error
try:
from ssl import HAS_SNI