llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/173379.diff


1 Files Affected:

- (modified) lldb/source/Interpreter/embedded_interpreter.py (+7-1) 


``````````diff
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")

``````````

</details>


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

Reply via email to