[Lldb-commits] [lldb] r361087 - [crashlog] Use loads() instead of readPlistFromString() for python 3.

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Fri May 17 18:57:13 PDT 2019


Author: davide
Date: Fri May 17 18:57:12 2019
New Revision: 361087

URL: http://llvm.org/viewvc/llvm-project?rev=361087&view=rev
Log:
[crashlog] Use loads() instead of readPlistFromString() for python 3.

<rdar://problem/50903413>

Modified:
    lldb/trunk/examples/python/crashlog.py

Modified: lldb/trunk/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=361087&r1=361086&r2=361087&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Fri May 17 18:57:12 2019
@@ -43,6 +43,12 @@ import sys
 import time
 import uuid
 
+def read_plist(s):
+    if sys.version_info.major == 3:
+        return plistlib.loads(s)
+    else:
+        return plistlib.readPlistFromString(s)
+
 try:
     # Just try for LLDB in case PYTHONPATH is already correctly setup
     import lldb
@@ -282,7 +288,7 @@ class CrashLog(symbolication.Symbolicato
                 s = subprocess.check_output(dsym_for_uuid_command, shell=True)
                 if s:
                     try:
-                        plist_root = plistlib.readPlistFromString(s)
+                        plist_root = read_plist(s)
                     except:
                         print(("Got exception: ", sys.exc_info()[1], " handling dsymForUUID output: \n", s))
                         raise




More information about the lldb-commits mailing list