Author: Ebuka Ezike
Date: 2025-12-23T17:00:31Z
New Revision: 66693921748f7c4e16bd08bc4a34ba537a769c9a

URL: 
https://github.com/llvm/llvm-project/commit/66693921748f7c4e16bd08bc4a34ba537a769c9a
DIFF: 
https://github.com/llvm/llvm-project/commit/66693921748f7c4e16bd08bc4a34ba537a769c9a.diff

LOG: [lldb] Improve detection of the readline backend (#173379)

readline.backend was added in Python 3.13 see
https://docs.python.org/3/library/readline.html#readline.backend

Added: 
    

Modified: 
    lldb/source/Interpreter/embedded_interpreter.py

Removed: 
    


################################################################################
diff  --git a/lldb/source/Interpreter/embedded_interpreter.py 
b/lldb/source/Interpreter/embedded_interpreter.py
index cdf166a4d1a23..42a9ab5fc367a 100644
--- a/lldb/source/Interpreter/embedded_interpreter.py
+++ b/lldb/source/Interpreter/embedded_interpreter.py
@@ -15,7 +15,13 @@
     have_readline = False
 else:
     have_readline = True
-    if "libedit" in readline.__doc__:
+
+    def is_libedit():
+        if hasattr(readline, "backend"):
+            return readline.backend == "editline"
+        return "libedit" in getattr(readline, "__doc__", "")
+
+    if is_libedit():
         readline.parse_and_bind("bind ^I rl_complete")
     else:
         readline.parse_and_bind("tab: complete")


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

Reply via email to