[Lldb-commits] [lldb] r350788 - [Python] Update checkDsymForUUIDIsOn to be compatible with Python 3.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 9 17:15:18 PST 2019


Author: davide
Date: Wed Jan  9 17:15:18 2019
New Revision: 350788

URL: http://llvm.org/viewvc/llvm-project?rev=350788&view=rev
Log:
[Python] Update checkDsymForUUIDIsOn to be compatible with Python 3.

Summary:
In python 2, strings and bytes are the same, but they're not in
python 3, hence the return of read() needs an explicit conversion.
While I'm around, rename the return of Popen() from `pipe` to
`process`, as that's what Popen returns.

Reviewers: JDevlieghere, friss, zturner, aprantl, serge-sans-paille

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D56517

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=350788&r1=350787&r2=350788&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Jan  9 17:15:18 2019
@@ -1061,14 +1061,15 @@ def getMyCommandLine():
 
 def checkDsymForUUIDIsNotOn():
     cmd = ["defaults", "read", "com.apple.DebugSymbols"]
-    pipe = subprocess.Popen(
+    process = subprocess.Popen(
         cmd,
         stdout=subprocess.PIPE,
         stderr=subprocess.STDOUT)
-    cmd_output = pipe.stdout.read()
-    if cmd_output and "DBGFileMappedPaths = " in cmd_output:
+    cmd_output = process.stdout.read()
+    output_str = cmd_output.decode("utf-8")
+    if "DBGFileMappedPaths = " in output_str:
         print("%s =>" % ' '.join(cmd))
-        print(cmd_output)
+        print(output_str)
         print(
             "Disable automatic lookup and caching of dSYMs before running the test suite!")
         print("Exiting...")




More information about the lldb-commits mailing list