зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
6d2c8f49cf
Коммит
1a6323e3aa
|
@ -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
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче