From 2f3cb7f2531e9170391bfec4fb45e74db678f69a 2010-01-01 05:30:51 From: Fernando Perez Date: 2010-01-01 05:30:51 Subject: [PATCH] Fix bugs when readline is absent (pdb and quitting would crash badly) https://bugs.launchpad.net/ipython/+bug/495173 --- diff --git a/IPython/core/iplib.py b/IPython/core/iplib.py index 823a2f1..127e52b 100644 --- a/IPython/core/iplib.py +++ b/IPython/core/iplib.py @@ -1450,6 +1450,8 @@ class InteractiveShell(Component, Magic): def set_completer_frame(self, frame=None): """Set the frame of the completer.""" + if not self.has_readline: + return if frame: self.Completer.namespace = frame.f_locals self.Completer.global_namespace = frame.f_globals @@ -1842,7 +1844,8 @@ class InteractiveShell(Component, Magic): except EOFError: if self.autoindent: self.rl_do_indent = False - self.readline_startup_hook(None) + if self.has_readline: + self.readline_startup_hook(None) self.write('\n') self.exit() except bdb.BdbQuit: