Bug 1891787 - Remove usage of six in mozbuild/mozconfig.py r=ahochheiden

Differential Revision: https://phabricator.services.mozilla.com/D207607
This commit is contained in:
serge-sans-paille 2024-04-30 13:46:32 +00:00
Родитель f87a5ea054
Коммит b1920088d7
1 изменённых файлов: 9 добавлений и 11 удалений

Просмотреть файл

@ -10,7 +10,6 @@ import traceback
from pathlib import Path from pathlib import Path
from textwrap import dedent from textwrap import dedent
import six
from mozboot.mozconfig import find_mozconfig from mozboot.mozconfig import find_mozconfig
from mozpack import path as mozpath from mozpack import path as mozpath
@ -57,7 +56,7 @@ class MozconfigLoadException(Exception):
{output} {output}
""" """
).format(output="\n".join([six.ensure_text(s) for s in self.output])) ).format(output="\n".join(self.output))
Exception.__init__(self, message) Exception.__init__(self, message)
@ -162,16 +161,15 @@ class MozconfigLoader(object):
try: try:
# We need to capture stderr because that's where the shell sends # We need to capture stderr because that's where the shell sends
# errors if execution fails. # errors if execution fails.
output = six.ensure_text( output = subprocess.check_output(
subprocess.check_output( command,
command, stderr=subprocess.STDOUT,
stderr=subprocess.STDOUT, cwd=self.topsrcdir,
cwd=self.topsrcdir, env=env,
env=env, universal_newlines=True,
universal_newlines=True, encoding="utf-8",
encoding="utf-8",
)
) )
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
lines = e.output.splitlines() lines = e.output.splitlines()