Bug 1575804 - Don't decode the result from get_cmd_output. r=chmanchester

Also don't pass universal_newlines to check_cmd_output. That was added
to make python 3 happier when check_cmd_output still returned bytes, to
hint subprocess to return a unicode string, but now that
check_cmd_output does the decoding, that's not needed anymore.

Differential Revision: https://phabricator.services.mozilla.com/D43205

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-08-26 22:05:51 +00:00
Родитель 390918caab
Коммит 46c7dfffb5
2 изменённых файлов: 4 добавлений и 6 удалений

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

@ -789,7 +789,7 @@ def real_host(value, shell):
if not value:
config_guess = os.path.join(os.path.dirname(__file__), '..',
'autoconf', 'config.guess')
host = check_cmd_output(shell, config_guess, universal_newlines=True).strip()
host = check_cmd_output(shell, config_guess).strip()
try:
return split_triplet(host)
except ValueError:

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

@ -2025,22 +2025,20 @@ def select_linker(linker, c_compiler, developer_options, enable_gold,
env = dict(os.environ)
env['LD_PRINT_OPTIONS'] = '1'
retcode, stdout, stderr = get_cmd_output(*cmd, env=env)
cmd_output = stdout.decode('utf-8')
stderr = stderr.decode('utf-8')
if retcode == 1 and 'Logging ld64 options' in stderr:
kind = 'ld64'
elif retcode != 0:
return None
elif 'GNU ld' in cmd_output:
elif 'GNU ld' in stdout:
# We are using the normal linker
kind = 'bfd'
elif 'GNU gold' in cmd_output:
elif 'GNU gold' in stdout:
kind = 'gold'
elif 'LLD' in cmd_output:
elif 'LLD' in stdout:
kind = 'lld'
else: