This commit is contained in:
Denizhan Dakılır 2025-12-23 14:12:48 +05:30 committed by GitHub
commit 7e3477b413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -111,7 +111,7 @@ class Cmd:
import readline
self.old_completer = readline.get_completer()
readline.set_completer(self.complete)
if readline.backend == "editline":
if getattr(readline, 'backend', None) == "editline":
if self.completekey == 'tab':
# libedit uses "^I" instead of "tab"
command_string = "bind ^I rl_complete"

View file

@ -364,7 +364,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
bdb.Bdb.__init__(self, skip=skip, backend=backend if backend else get_default_backend())
cmd.Cmd.__init__(self, completekey, stdin, stdout)
sys.audit("pdb.Pdb")
if stdin:
if stdin and not getattr(stdin, 'isatty', lambda: False)():
self.use_rawinput = False
self.prompt = '(Pdb) '
self.aliases = {}