Make the stack script python3.5 compatible.
Ensure that the script works on buildbots.
Test: adb shell debuggerd -b <pid> | development/scripts/stack
Change-Id: I3fd4a0ed78ff3245d1ab2f6e842446888c5c7b8b
diff --git a/scripts/symbol.py b/scripts/symbol.py
index 23b8737..360a2cb 100755
--- a/scripts/symbol.py
+++ b/scripts/symbol.py
@@ -36,7 +36,7 @@
stream = None
try:
cmd = "build/soong/soong_ui.bash --dumpvar-mode --abs TARGET_OUT_UNSTRIPPED"
- stream = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf8', shell=True).stdout
+ stream = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True, shell=True).stdout
return str(stream.read().strip())
finally:
if stream is not None:
@@ -91,7 +91,7 @@
return pipe
def SpawnProcess(self, cmd):
- return subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, encoding='utf8')
+ return subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
def TerminateProcess(self, pipe):
pipe.stdin.close()
@@ -390,7 +390,7 @@
current_symbol_addr = 0 # The address of the current function.
addr_index = 0 # The address that we are currently looking for.
- stream = subprocess.Popen(cmd, stdout=subprocess.PIPE, encoding='utf8').stdout
+ stream = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True).stdout
for line in stream:
# Is it a function line like:
# 000177b0 <android::IBinder::~IBinder()>: