Modified: trunk/Tools/Scripts/test-webkitpy-python3 (251490 => 251491)
--- trunk/Tools/Scripts/test-webkitpy-python3 2019-10-23 19:41:09 UTC (rev 251490)
+++ trunk/Tools/Scripts/test-webkitpy-python3 2019-10-23 20:02:05 UTC (rev 251491)
@@ -37,6 +37,7 @@
'webkitpy.common.thread',
'webkitpy.common.net',
'webkitpy.common.watchlist',
+ 'webkitpy.results',
]
Modified: trunk/Tools/Scripts/webkitpy/results/upload.py (251490 => 251491)
--- trunk/Tools/Scripts/webkitpy/results/upload.py 2019-10-23 19:41:09 UTC (rev 251490)
+++ trunk/Tools/Scripts/webkitpy/results/upload.py 2019-10-23 20:02:05 UTC (rev 251491)
@@ -69,7 +69,7 @@
buildbot_args = [details.get(arg, None) is None for arg in obj.BUILDBOT_DETAILS]
if any(buildbot_args) and not all(buildbot_args):
raise ValueError('All buildbot details must be defined for upload, details missing: {}'.format(', '.join(
- [obj.BUILDBOT_DETAILS[i] for i in xrange(len(obj.BUILDBOT_DETAILS)) if buildbot_args[i]],
+ [obj.BUILDBOT_DETAILS[i] for i in range(len(obj.BUILDBOT_DETAILS)) if buildbot_args[i]],
)))
def unpack_test(current, path_to_test, data):
@@ -81,9 +81,15 @@
unpack_test(current[path_to_test[0]], path_to_test[1:], data)
results = {}
- for test, data in obj.results.iteritems():
- unpack_test(results, test.split('/'), data)
+ # FIXME: Python 2 removal, this dictionary is large enough that Python 2 can't just use items
+ if sys.version_info > (3, 0):
+ for test, data in obj.results.items():
+ unpack_test(results, test.split('/'), data)
+ else:
+ for test, data in obj.results.iteritems():
+ unpack_test(results, test.split('/'), data)
+
result = dict(
version=obj.VERSION,
suite=obj.suite,
@@ -129,7 +135,7 @@
architecture=architecture or host_platform.machine(),
)
optional_data = dict(version_name=version_name, model=model, style=style, flavor=flavor, sdk=sdk)
- config.update({key: value for key, value in optional_data.iteritems() if value is not None})
+ config.update({key: value for key, value in optional_data.items() if value is not None})
return config
@staticmethod
@@ -157,7 +163,7 @@
def create_run_stats(start_time=None, end_time=None, tests_skipped=None, **kwargs):
stats = dict(**kwargs)
optional_data = dict(start_time=start_time, end_time=end_time, tests_skipped=tests_skipped)
- stats.update({key: value for key, value in optional_data.iteritems() if value is not None})
+ stats.update({key: value for key, value in optional_data.items() if value is not None})
return stats
@staticmethod
@@ -166,7 +172,7 @@
# Tests which don't declare expectations or results are assumed to have passed.
optional_data = dict(expected=expected, actual=actual, log=log)
- result.update({key: value for key, value in optional_data.iteritems() if value is not None})
+ result.update({key: value for key, value in optional_data.items() if value is not None})
return result
def upload(self, hostname, log_line_func=lambda val: sys.stdout.write(val + '\n')):
Modified: trunk/Tools/Scripts/webkitpy/results/upload_unittest.py (251490 => 251491)
--- trunk/Tools/Scripts/webkitpy/results/upload_unittest.py 2019-10-23 19:41:09 UTC (rev 251490)
+++ trunk/Tools/Scripts/webkitpy/results/upload_unittest.py 2019-10-23 20:02:05 UTC (rev 251491)
@@ -25,6 +25,7 @@
import collections
import json
import requests
+import sys
import time
import unittest
@@ -31,12 +32,15 @@
from webkitpy.results.upload import Upload
from webkitpy.thirdparty import mock
+if sys.version_info > (3, 0):
+ basestring = str
+
class UploadTest(unittest.TestCase):
class Options(object):
def __init__(self, **kwargs):
- for key, value in kwargs.iteritems():
+ for key, value in kwargs.items():
setattr(self, key, value)
class MockResponse(object):
@@ -52,7 +56,7 @@
if isinstance(data, basestring):
return str(data)
elif isinstance(data, collections.Mapping):
- return dict(map(UploadTest.normalize, data.iteritems()))
+ return dict(map(UploadTest.normalize, data.items()))
elif isinstance(data, collections.Iterable):
return type(data)(map(UploadTest.normalize, data))
return data