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: I55b41645e3285739738cdc191e77dfbe28d3297b
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2856012
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Scott Graham 2021-04-28 08:46:51 -07:00
parent 66eb800996
commit bf9f1fb7c5

View File

@ -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 os
import shutil
import subprocess
import sys
import urllib2
import urllib.request
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
@ -45,16 +45,16 @@ def main():
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