Bug 1592855 - run mach vendor aom with python3 r=dminor

Changes:
- update sections of `generate_sources_mozbuild.py` and `cmakeparser.py` to be python3 compatible
- change import of `urlparse` to be python3 compatible

Depends on D51414

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edwin Takahashi 2019-11-04 20:31:43 +00:00
Родитель b66e852ab2
Коммит 9a7b0768dc
3 изменённых файлов: 8 добавлений и 6 удалений

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

@ -135,7 +135,7 @@ def evaluate(variables, cache_variables, parsed):
variable = arguments[1]
values = arguments[2:]
if action == 'APPEND':
if not variables.has_key(variable):
if variable not in variables:
variables[variable] = ' '.join(values)
else:
variables[variable] += ' ' + ' '.join(values)
@ -145,7 +145,7 @@ def evaluate(variables, cache_variables, parsed):
variable = arguments[0]
value = arguments[2]
# Allow options to be override without changing CMake files
if not variables.has_key(variable):
if variable not in variables:
variables[variable] = value
elif command == 'return':
return False, sources
@ -156,7 +156,7 @@ def evaluate(variables, cache_variables, parsed):
try:
cache = values.index('CACHE')
values = values[0:cache]
if not variables.has_key(variable):
if variable not in variables:
variables[variable] = ' '.join(values)
cache_variables.append(variable)
except ValueError:

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

@ -82,7 +82,7 @@ if __name__ == '__main__':
'AOM_TEST_TEST_CMAKE_': 1, #prevent building tests
}
f = open('sources.mozbuild', 'wb')
f = open('sources.mozbuild', 'w')
f.write('# This file is generated. Do not edit.\n\n')
f.write('files = {\n')
@ -130,6 +130,8 @@ if __name__ == '__main__':
exports = filter(lambda x: not re.search('(internal|src)', x), exports)
exports = filter(lambda x: not re.search('(emmintrin_compat.h|mem_.*|msvc.h|aom_once.h)$', x), exports)
sources = list(sources)
for export in exports:
sources.remove(export)
@ -138,7 +140,7 @@ if __name__ == '__main__':
# The build system is unhappy if two files have the same prefix
# In libaom, sometimes .asm and .c files share the same prefix
for i in xrange(len(sources) - 1):
for i in range(len(sources) - 1):
if sources[i].endswith('.asm'):
if os.path.splitext(sources[i])[0] == os.path.splitext(sources[i + 1])[0]:
old = sources[i]

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

@ -15,7 +15,7 @@ import requests
import re
import sys
import tarfile
from urlparse import urlparse
from urllib.parse import urlparse
class VendorAOM(MozbuildObject):