[sanitizer] Upgrade android scripts to python 3

This commit is contained in:
Vitaly Buka 2021-07-13 20:45:04 -07:00
parent 40ce58d0ca
commit 94210b12d1
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ def host_to_device_path(path):
def adb(args, attempts = 1, timeout_sec = 600):
if verbose:
print args
print(args)
tmpname = tempfile.mktemp()
out = open(tmpname, 'w')
ret = 255
@ -23,11 +23,11 @@ def adb(args, attempts = 1, timeout_sec = 600):
attempts -= 1
ret = subprocess.call(['timeout', str(timeout_sec), ADB] + args, stdout=out, stderr=subprocess.STDOUT)
if ret != 0:
print "adb command failed", args
print tmpname
print("adb command failed", args)
print(tmpname)
out.close()
out = open(tmpname, 'r')
print out.read()
print(out.read())
out.close()
os.unlink(tmpname)
return ret

View File

@ -11,7 +11,7 @@ def build_env():
args = []
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
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'):
args.append('%s="%s"' % (key, value.replace('"', '\\"')))
return ' '.join(args)