Fix FullScreen crash in Webapp
[platform/framework/web/chromium-efl.git] / tools / download_optimization_profile.py
index 6cc5359..ba4592d 100755 (executable)
@@ -1,5 +1,5 @@
-#!/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)
@@ -21,10 +21,7 @@ import os
 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'
 
@@ -51,7 +48,10 @@ def WriteLocalProfileName(name, local_profile_name_path):
 
 
 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: