Skip to content

Commit 65c24e5

Browse files
committed
[lldb][examples] Use "chr" in CFString.py
Python3 removed "unichr" when string encoding was changed, so this code tried to import that then defaulted to "chr" if it couldn't. Since LLVM requires >=3.8 we can use "chr" directly.
1 parent 7ab271c commit 65c24e5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lldb/examples/summaries/cocoa/CFString.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
import lldb.runtime.objc.objc_runtime
1212
import lldb.formatters.Logger
1313

14-
try:
15-
unichr
16-
except NameError:
17-
unichr = chr
18-
1914

2015
def CFString_SummaryProvider(valobj, dict):
2116
logger = lldb.formatters.Logger.Logger()
@@ -107,7 +102,7 @@ def read_unicode(self, pointer, max_len=2048):
107102
value = b1 * 256 + b0
108103
else:
109104
value = b0 * 256 + b1
110-
pystr = pystr + unichr(value)
105+
pystr = pystr + chr(value)
111106
# read max_len unicode values, not max_len bytes
112107
max_len = max_len - 1
113108
return pystr

0 commit comments

Comments
 (0)