[go: nahoru, domu]

Python3 Migration - Devil clients in: tools/

Chops has set the goal of getting off Python 2 in all systems needed
to produce Chromium Browser builds (at any workstation) by EOY. All
projects that are DEPS'ed into a Chromium build are in scope. To
learn more about this project refer to: go/chops-py3migration-chromium

Bug: 1223617
Change-Id: I494dbd37e1b20216b3e84becccb499921656ae3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3086101
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Commit-Queue: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/master@{#910512}
diff --git a/tools/cygprofile/orderfile_generator_backend.py b/tools/cygprofile/orderfile_generator_backend.py
index 9beefc6..b9f0200 100755
--- a/tools/cygprofile/orderfile_generator_backend.py
+++ b/tools/cygprofile/orderfile_generator_backend.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env vpython
+#!/usr/bin/env vpython3
 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
@@ -13,7 +13,6 @@
   tools/cygprofile/orderfile_generator_backend.py --use-goma --target-arch=arm
 """
 
-from __future__ import print_function
 
 import argparse
 import csv
@@ -388,7 +387,7 @@
       Exception if the hash file does not match the file.
       NotImplementedError when the commit logic hasn't been overridden.
     """
-    files_to_commit = list(filter(None, files))
+    files_to_commit = [_f for _f in files if _f]
     if files_to_commit:
       self._CommitStashedFiles(files_to_commit)
 
@@ -964,8 +963,8 @@
     elif self._options.manual_symbol_offsets:
       assert self._options.manual_libname
       assert self._options.manual_objdir
-      with file(self._options.manual_symbol_offsets) as f:
-        symbol_offsets = [int(x) for x in f.xreadlines()]
+      with open(self._options.manual_symbol_offsets) as f:
+        symbol_offsets = [int(x) for x in f]
       processor = process_profiles.SymbolOffsetProcessor(
           self._compiler.manual_libname)
       generator = cyglog_to_orderfile.OffsetOrderfileGenerator(