diff options
| author | Adrian Prantl <aprantl@apple.com> | 2019-06-14 15:39:14 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2019-06-14 15:39:14 +0000 |
| commit | 573ffd88a0e312c71fbeaaf781c569c9cb51e5e8 (patch) | |
| tree | 5be013dcff91e59f736fed1308d09db88e06a87b /lldb/examples/python | |
| parent | 38be2c65b629ad76e6dab5844fa8093792ff941c (diff) | |
| download | bcm5719-llvm-573ffd88a0e312c71fbeaaf781c569c9cb51e5e8.tar.gz bcm5719-llvm-573ffd88a0e312c71fbeaaf781c569c9cb51e5e8.zip | |
Python 3: decode string as utf-8 to avoid type mismatch.
rdar://problem/51464644
Differential Revision: https://reviews.llvm.org/D63311
llvm-svn: 363413
Diffstat (limited to 'lldb/examples/python')
| -rwxr-xr-x | lldb/examples/python/crashlog.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py index 602bb28092d..3ccf6f71e2b 100755 --- a/lldb/examples/python/crashlog.py +++ b/lldb/examples/python/crashlog.py @@ -58,7 +58,7 @@ except ImportError: platform_system = platform.system() if platform_system == 'Darwin': # On Darwin, try the currently selected Xcode directory - xcode_dir = subprocess.check_output("xcode-select --print-path", shell=True) + xcode_dir = subprocess.check_output("xcode-select --print-path", shell=True).decode("utf-8") if xcode_dir: lldb_python_dirs.append( os.path.realpath( @@ -232,7 +232,7 @@ class CrashLog(symbolication.Symbolicator): if not os.path.exists(dsymForUUIDBinary): try: dsymForUUIDBinary = subprocess.check_output('which dsymForUUID', - shell=True).rstrip('\n') + shell=True).decode("utf-8").rstrip('\n') except: dsymForUUIDBinary = "" @@ -300,7 +300,7 @@ class CrashLog(symbolication.Symbolicator): if os.path.exists(self.dsymForUUIDBinary): dsym_for_uuid_command = '%s %s' % ( self.dsymForUUIDBinary, uuid_str) - s = subprocess.check_output(dsym_for_uuid_command, shell=True) + s = subprocess.check_output(dsym_for_uuid_command, shell=True).decode("utf-8") if s: try: plist_root = read_plist(s) @@ -326,7 +326,7 @@ class CrashLog(symbolication.Symbolicator): try: dsym = subprocess.check_output( ["/usr/bin/mdfind", - "com_apple_xcode_dsym_uuids == %s"%uuid_str])[:-1] + "com_apple_xcode_dsym_uuids == %s"%uuid_str]).decode("utf-8")[:-1] if dsym and os.path.exists(dsym): print(('falling back to binary inside "%s"'%dsym)) self.symfile = dsym @@ -764,7 +764,7 @@ def save_crashlog(debugger, command, exe_ctx, result, dict): (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))) out_file.write( 'OS Version: Mac OS X %s (%s)\n' % - (platform.mac_ver()[0], subprocess.check_output('sysctl -n kern.osversion', shell=True))) + (platform.mac_ver()[0], subprocess.check_output('sysctl -n kern.osversion', shell=True).decode("utf-8"))) out_file.write('Report Version: 9\n') for thread_idx in range(process.num_threads): thread = process.thread[thread_idx] |

