зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1751990 - Removed usages of six underneath toolkit directory r=firefox-build-system-reviewers,glandium
Depends on D152463 Differential Revision: https://phabricator.services.mozilla.com/D137058
This commit is contained in:
Родитель
94699183f2
Коммит
676a85b30d
|
@ -7,7 +7,6 @@ import json
|
|||
import pytoml
|
||||
import re
|
||||
import sys
|
||||
|
||||
import voluptuous
|
||||
import voluptuous.humanize
|
||||
from voluptuous import Schema, Optional, Any, All, Required, Length, Range, Msg, Match
|
||||
|
|
|
@ -6,11 +6,8 @@
|
|||
|
||||
from __future__ import unicode_literals, print_function
|
||||
|
||||
import six
|
||||
|
||||
|
||||
def main(output, locale=None):
|
||||
assert locale is not None
|
||||
# update.locale is a trivial file but let's be unicode aware anyway.
|
||||
locale = six.ensure_text(locale)
|
||||
print(locale, file=output)
|
||||
|
|
|
@ -6,16 +6,13 @@ from __future__ import absolute_import, unicode_literals, print_function
|
|||
|
||||
import sys
|
||||
import hashlib
|
||||
import re
|
||||
import os
|
||||
import functools
|
||||
from mozbuild.preprocessor import Preprocessor
|
||||
from mozbuild.util import DefinesAction
|
||||
from mozpack.packager.unpack import UnpackFinder
|
||||
from mozpack.files import DeflatedFile
|
||||
from collections import OrderedDict
|
||||
import six
|
||||
from six import StringIO
|
||||
from io import StringIO
|
||||
import argparse
|
||||
import buildconfig
|
||||
|
||||
|
@ -58,8 +55,8 @@ def find_dupes(source, allowed_dupes, bail=True):
|
|||
checksum = hashlib.sha1()
|
||||
content_size = 0
|
||||
for buf in iter(functools.partial(f.open().read, chunk_size), b""):
|
||||
checksum.update(six.ensure_binary(buf))
|
||||
content_size += len(six.ensure_binary(buf))
|
||||
checksum.update(buf)
|
||||
content_size += len(buf)
|
||||
m = checksum.digest()
|
||||
if m not in checksums:
|
||||
if isinstance(f, DeflatedFile):
|
||||
|
@ -73,7 +70,7 @@ def find_dupes(source, allowed_dupes, bail=True):
|
|||
num_dupes = 0
|
||||
unexpected_dupes = []
|
||||
for m, (size, compressed, paths) in sorted(
|
||||
six.iteritems(checksums), key=lambda x: x[1][1]
|
||||
checksums.items(), key=lambda x: x[1][1]
|
||||
):
|
||||
if len(paths) > 1:
|
||||
_compressed = " (%d compressed)" % compressed if compressed != size else ""
|
||||
|
|
|
@ -33,8 +33,7 @@ from collections import OrderedDict
|
|||
from createprecomplete import generate_precomplete
|
||||
import os
|
||||
import plistlib
|
||||
import six
|
||||
from six import StringIO
|
||||
from io import StringIO
|
||||
import subprocess
|
||||
|
||||
|
||||
|
@ -58,7 +57,7 @@ class RemovedFiles(GeneratedFile):
|
|||
|
||||
def __init__(self, copier):
|
||||
self.copier = copier
|
||||
GeneratedFile.__init__(self, b"")
|
||||
GeneratedFile.__init__(self, "")
|
||||
|
||||
def handle_line(self, f):
|
||||
f = f.strip()
|
||||
|
@ -66,7 +65,7 @@ class RemovedFiles(GeneratedFile):
|
|||
return
|
||||
if self.copier.contains(f):
|
||||
errors.error("Removal of packaged file(s): %s" % f)
|
||||
self.content += six.ensure_binary(f) + b"\n"
|
||||
self.content = f + "\n"
|
||||
|
||||
|
||||
def split_define(define):
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
import argparse
|
||||
import os
|
||||
import six
|
||||
import buildconfig
|
||||
from mozpack.packager.formats import (
|
||||
FlatFormatter,
|
||||
|
@ -67,7 +66,7 @@ def main():
|
|||
packager.close()
|
||||
|
||||
# Transplant jar preloading information.
|
||||
for path, log in six.iteritems(app1_finder.jarlogs):
|
||||
for path, log in app1_finder.jarlogs.items():
|
||||
assert isinstance(copier[path], Jarrer)
|
||||
copier[path].preload(log)
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
from codecs import BOM_UTF16_LE
|
||||
import io
|
||||
from os.path import join, isfile
|
||||
import six
|
||||
import sys
|
||||
from optparse import OptionParser
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче