-#!/usr/bin/env python
-# Copyright 2018 The Chromium Authors. All rights reserved.
+#!/usr/bin/env vpython3
+# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script is used to update local profiles (AFDO, PGO or orderfiles)
import subprocess
import sys
-if sys.version_info.major == 2:
- from urllib2 import urlopen
-else:
- from urllib.request import urlopen
+from urllib.request import urlopen
GS_HTTP_URL = 'https://storage.googleapis.com'
def CheckCallOrExit(cmd):
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ proc = subprocess.Popen(cmd,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ encoding='utf-8')
stdout, stderr = proc.communicate()
exit_code = proc.wait()
if not exit_code: