Author: David Spickett
Date: 2025-10-16T09:58:54Z
New Revision: 65c24e50228273995133954aefe7ae3d5a041a19

URL: 
https://github.com/llvm/llvm-project/commit/65c24e50228273995133954aefe7ae3d5a041a19
DIFF: 
https://github.com/llvm/llvm-project/commit/65c24e50228273995133954aefe7ae3d5a041a19.diff

LOG: [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.

Added: 
    

Modified: 
    lldb/examples/summaries/cocoa/CFString.py

Removed: 
    


################################################################################
diff  --git a/lldb/examples/summaries/cocoa/CFString.py 
b/lldb/examples/summaries/cocoa/CFString.py
index 74bd927e9db21..02b670651cd53 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -11,11 +11,6 @@
 import lldb.runtime.objc.objc_runtime
 import lldb.formatters.Logger
 
-try:
-    unichr
-except NameError:
-    unichr = chr
-
 
 def CFString_SummaryProvider(valobj, dict):
     logger = lldb.formatters.Logger.Logger()
@@ -107,7 +102,7 @@ def read_unicode(self, pointer, max_len=2048):
                 value = b1 * 256 + b0
             else:
                 value = b0 * 256 + b1
-            pystr = pystr + unichr(value)
+            pystr = pystr + chr(value)
             # read max_len unicode values, not max_len bytes
             max_len = max_len - 1
         return pystr


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to