From fd1e41623dc1ef11c4bfb5e98f7be5f37a3ed6c9 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Tue, 27 Apr 2021 22:24:36 +0100 Subject: [PATCH] Make the stack script python3.5 compatible. Ensure that the script works on buildbots. Test: adb shell debuggerd -b | development/scripts/stack Change-Id: I3fd4a0ed78ff3245d1ab2f6e842446888c5c7b8b --- scripts/symbol.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/symbol.py b/scripts/symbol.py index 23b87379e..360a2cbc3 100755 --- a/scripts/symbol.py +++ b/scripts/symbol.py @@ -36,7 +36,7 @@ def FindSymbolsDir(): 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 @@ class ProcessCache: 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 @@ def CallObjdumpForSet(lib, unique_addrs): 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 :