diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/tools/clang/pylib | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/tools/clang/pylib')
-rwxr-xr-x | chromium/tools/clang/pylib/clang/compile_db.py | 2 | ||||
-rwxr-xr-x | chromium/tools/clang/pylib/clang/compile_db_test.py | 6 | ||||
-rwxr-xr-x | chromium/tools/clang/pylib/clang/plugin_testing.py | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/chromium/tools/clang/pylib/clang/compile_db.py b/chromium/tools/clang/pylib/clang/compile_db.py index 46220af8b90..50decf71907 100755 --- a/chromium/tools/clang/pylib/clang/compile_db.py +++ b/chromium/tools/clang/pylib/clang/compile_db.py @@ -67,7 +67,7 @@ def _ProcessEntry(entry): match = _RSP_RE.search(entry['command']) if match: rsp_path = os.path.join(entry['directory'], match.group(2)) - rsp_contents = file(rsp_path).read() + rsp_contents = open(rsp_path).read() entry['command'] = ''.join([ entry['command'][:match.start(1)], rsp_contents, diff --git a/chromium/tools/clang/pylib/clang/compile_db_test.py b/chromium/tools/clang/pylib/clang/compile_db_test.py index 493f2f815db..9ec818bbb5e 100755 --- a/chromium/tools/clang/pylib/clang/compile_db_test.py +++ b/chromium/tools/clang/pylib/clang/compile_db_test.py @@ -62,7 +62,11 @@ class CompileDbTest(unittest.TestCase): _TEST_COMPILE_DB) # Assert no changes were made. - self.assertItemsEqual(processed_compile_db, _TEST_COMPILE_DB) + try: + # assertItemsEqual is renamed assertCountEqual in Python3. + self.assertCountEqual(processed_compile_db, _TEST_COMPILE_DB) + except AttributeError: + self.assertItemsEqual(processed_compile_db, _TEST_COMPILE_DB) def testProcessForWindows(self): sys.platform = 'win32' diff --git a/chromium/tools/clang/pylib/clang/plugin_testing.py b/chromium/tools/clang/pylib/clang/plugin_testing.py index 7082ac87978..6b2e6067118 100755 --- a/chromium/tools/clang/pylib/clang/plugin_testing.py +++ b/chromium/tools/clang/pylib/clang/plugin_testing.py @@ -63,7 +63,7 @@ class ClangPluginTest(object): cmd = clang_cmd[:] try: # Some tests need to run with extra flags. - cmd.extend(file('%s.flags' % test_name).read().split()) + cmd.extend(open('%s.flags' % test_name).read().split()) except IOError: pass cmd.append(test) @@ -85,7 +85,9 @@ class ClangPluginTest(object): def RunOneTest(self, test_name, cmd): try: - actual = subprocess.check_output(cmd, stderr=subprocess.STDOUT) + actual = subprocess.check_output(cmd, + stderr=subprocess.STDOUT, + universal_newlines=True) except subprocess.CalledProcessError as e: # Some plugin tests intentionally trigger compile errors, so just ignore # an exit code that indicates failure. |