Update install_linux_sysroot for py3
No intended functionality change, but 'python' no longer reliably points
to python2, at least on my Linux machine.
Change-Id: I06786f3bd4d774b9470841a066ef33d17fc95c05
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2856012
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
GitOrigin-RevId: bf9f1fb7c5384bf5c3be6d3714c2d501d31b8ca2
diff --git a/build/install_linux_sysroot.py b/build/install_linux_sysroot.py
index 4e89837..c05c4d5 100755
--- a/build/install_linux_sysroot.py
+++ b/build/install_linux_sysroot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright 2018 The Crashpad Authors. All rights reserved.
#
@@ -21,7 +21,7 @@
import shutil
import subprocess
import sys
-import urllib2
+import urllib.request
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -45,16 +45,16 @@
if s.read() == url:
return
- print 'Installing Debian root image from %s' % url
+ print('Installing Debian root image from %s' % url)
if os.path.isdir(sysroot):
shutil.rmtree(sysroot)
os.mkdir(sysroot)
tarball = os.path.join(sysroot, FILENAME)
- print 'Downloading %s' % url
+ print('Downloading %s' % url)
for _ in range(3):
- response = urllib2.urlopen(url)
+ response = urllib.request.urlopen(url)
with open(tarball, 'wb') as f:
f.write(response.read())
break