Bug 1606504 - mozbuild/artifact_cache.py and mozbuild/dotproperties.py support Python 3 r=firefox-build-system-reviewers,mshal

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ricky Stewart 2020-01-02 16:38:25 +00:00
Родитель 6d2c8f49cf
Коммит 1a6323e3aa
5 изменённых файлов: 10 добавлений и 7 удалений

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

@ -27,7 +27,8 @@ import binascii
import hashlib
import logging
import os
import urlparse
import six
import six.moves.urllib.parse as urlparse
from mozbuild.util import (
mkdir,
@ -167,7 +168,7 @@ class ArtifactCache(object):
# extract the build ID from the downloaded artifact and use it to make a
# human readable unique name, but extracting build IDs is time consuming
# (especially on Mac OS X, where we must mount a large DMG file).
hash = hashlib.sha256(url).hexdigest()[:16]
hash = hashlib.sha256(six.ensure_binary(url)).hexdigest()[:16]
# Strip query string and fragments.
basename = os.path.basename(urlparse.urlparse(url).path)
fname = hash + '-' + basename

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

@ -9,6 +9,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import codecs
import re
import six
import sys
if sys.version_info[0] == 3:
@ -53,7 +54,7 @@ class DotProperties:
if not prefix.endswith('.'):
prefix = prefix + '.'
indexes = []
for k, v in self._properties.iteritems():
for k, v in six.iteritems(self._properties):
if not k.startswith(prefix):
continue
key = k[len(prefix):]
@ -74,7 +75,8 @@ class DotProperties:
if not prefix.endswith('.'):
prefix = prefix + '.'
D = dict((k[len(prefix):], v) for k, v in self._properties.iteritems()
D = dict((k[len(prefix):], v) for k, v
in six.iteritems(self._properties)
if k.startswith(prefix) and '.' not in k[len(prefix):])
for required_key in required_keys:

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

@ -1,8 +1,10 @@
[DEFAULT]
subsuite = mozbuild
[test_artifact_cache.py]
[test_base.py]
[test_containers.py]
[test_dotproperties.py]
[test_expression.py]
[test_jarmaker.py]
[test_licenses.py]

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

@ -36,6 +36,4 @@ skip-if = (os == "win")
[frontend/test_namespaces.py]
[frontend/test_reader.py]
[frontend/test_sandbox.py]
[test_artifact_cache.py]
[test_dotproperties.py]
[test_util.py]

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

@ -5,7 +5,7 @@ from __future__ import absolute_import, print_function, unicode_literals
import os
import unittest
from StringIO import StringIO
from six import StringIO
import mozpack.path as mozpath