Bug 1681164 - python3 - awsy - python3 fixes. r=perftest-reviewers,jmaher

Differential Revision: https://phabricator.services.mozilla.com/D99047
This commit is contained in:
Bob Clary 2020-12-14 20:10:22 +00:00
Родитель 6cec6d5037
Коммит f86c9fed5a
4 изменённых файлов: 7 добавлений и 4 удалений

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

@ -121,7 +121,7 @@ def calculate_memory_report_values(
# If a process name is provided, restricted output to processes matching
# that name.
if process_names is not None:
for k in totals.keys():
for k in list(totals.keys()):
if not any([process_name in k for process_name in process_names]):
del totals[k]

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

@ -160,7 +160,7 @@ def create_suite(
totals_uss = parse_about_memory.calculate_memory_report_values(
memory_report_path, "resident-unique"
)
value = totals_rss.values()[0] + sum(
value = list(totals_rss.values())[0] + sum(
[v for k, v in totals_uss.iteritems() if "Main" not in k]
)

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

@ -9,6 +9,8 @@ import logging
import os
import sys
import six
from mozbuild.base import (
MachCommandBase,
MachCommandConditions as conditions,
@ -112,7 +114,7 @@ class MachCommands(MachCommandBase):
else:
kwargs["testvars"] = [runtime_testvars_path]
runtime_testvars_file = open(runtime_testvars_path, "wb")
runtime_testvars_file = open(runtime_testvars_path, "wb" if six.PY2 else "w")
runtime_testvars_file.write(json.dumps(runtime_testvars, indent=2))
runtime_testvars_file.close()

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

@ -33,6 +33,7 @@ from mozharness.mozilla.testing.codecoverage import (
code_coverage_config_options,
)
PY2 = sys.version_info.major == 2
scripts_path = os.path.abspath(os.path.dirname(os.path.dirname(mozharness.__file__)))
external_tools_path = os.path.join(scripts_path, "external_tools")
@ -242,7 +243,7 @@ class AWSY(TestingMixin, MercurialScript, TooltoolMixin, CodeCoverageMixin):
env["EXTERNALTOOLSPATH"] = external_tools_path
runtime_testvars_path = os.path.join(self.awsy_path, "runtime-testvars.json")
runtime_testvars_file = open(runtime_testvars_path, "wb")
runtime_testvars_file = open(runtime_testvars_path, "wb" if PY2 else "w")
runtime_testvars_file.write(json.dumps(runtime_testvars, indent=2))
runtime_testvars_file.close()