forked from OSchip/llvm-project
[sanitizer] Upgrade android scripts to python 3
This commit is contained in:
parent
40ce58d0ca
commit
94210b12d1
|
@ -15,7 +15,7 @@ def host_to_device_path(path):
|
||||||
|
|
||||||
def adb(args, attempts = 1, timeout_sec = 600):
|
def adb(args, attempts = 1, timeout_sec = 600):
|
||||||
if verbose:
|
if verbose:
|
||||||
print args
|
print(args)
|
||||||
tmpname = tempfile.mktemp()
|
tmpname = tempfile.mktemp()
|
||||||
out = open(tmpname, 'w')
|
out = open(tmpname, 'w')
|
||||||
ret = 255
|
ret = 255
|
||||||
|
@ -23,11 +23,11 @@ def adb(args, attempts = 1, timeout_sec = 600):
|
||||||
attempts -= 1
|
attempts -= 1
|
||||||
ret = subprocess.call(['timeout', str(timeout_sec), ADB] + args, stdout=out, stderr=subprocess.STDOUT)
|
ret = subprocess.call(['timeout', str(timeout_sec), ADB] + args, stdout=out, stderr=subprocess.STDOUT)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
print "adb command failed", args
|
print("adb command failed", args)
|
||||||
print tmpname
|
print(tmpname)
|
||||||
out.close()
|
out.close()
|
||||||
out = open(tmpname, 'r')
|
out = open(tmpname, 'r')
|
||||||
print out.read()
|
print(out.read())
|
||||||
out.close()
|
out.close()
|
||||||
os.unlink(tmpname)
|
os.unlink(tmpname)
|
||||||
return ret
|
return ret
|
||||||
|
|
|
@ -11,7 +11,7 @@ def build_env():
|
||||||
args = []
|
args = []
|
||||||
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
|
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
|
||||||
args.append('LD_LIBRARY_PATH=%s' % (ANDROID_TMPDIR,))
|
args.append('LD_LIBRARY_PATH=%s' % (ANDROID_TMPDIR,))
|
||||||
for (key, value) in os.environ.items():
|
for (key, value) in list(os.environ.items()):
|
||||||
if key in ['ASAN_ACTIVATION_OPTIONS', 'SCUDO_OPTIONS'] or key.endswith('SAN_OPTIONS'):
|
if key in ['ASAN_ACTIVATION_OPTIONS', 'SCUDO_OPTIONS'] or key.endswith('SAN_OPTIONS'):
|
||||||
args.append('%s="%s"' % (key, value.replace('"', '\\"')))
|
args.append('%s="%s"' % (key, value.replace('"', '\\"')))
|
||||||
return ' '.join(args)
|
return ' '.join(args)
|
||||||
|
|
Loading…
Reference in New Issue