Skip to content

Conversation

@da-viper
Copy link
Contributor

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

readline.backend was added in Python 3.13
@llvmbot
Copy link
Member

llvmbot commented Dec 23, 2025

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

Changes

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

@da-viper da-viper merged commit 6669392 into llvm:main Dec 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants