From 33f6dc7fbf8ddcfeb28722ac683231f13fb0e8db 2011-09-15 17:55:16 From: MinRK Date: 2011-09-15 17:55:16 Subject: [PATCH] avoid missing readline warning in zmqshell InteractiveShell.set_autoindent() warns when readline is missing, and the zmqshell no longer loads readline. This changes the condition of the warning to only if it is being enabled, and prevents enabling autoindent in the zmqshell. --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 2b3fb36..b048248 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -472,7 +472,7 @@ class InteractiveShell(SingletonConfigurable, Magic): If called with no arguments, it acts as a toggle.""" - if not self.has_readline: + if value != 0 and not self.has_readline: if os.name == 'posix': warn("The auto-indent feature requires the readline library") self.autoindent = 0 diff --git a/IPython/zmq/zmqshell.py b/IPython/zmq/zmqshell.py index a33779f..7cb11d3 100644 --- a/IPython/zmq/zmqshell.py +++ b/IPython/zmq/zmqshell.py @@ -86,6 +86,9 @@ class ZMQInteractiveShell(InteractiveShell): # to the terminal frontend. colors_force = CBool(True) readline_use = CBool(False) + # autoindent has no meaning in a zmqshell, and attempting to enable it + # will print a warning in the absence of readline. + autoindent = CBool(False) exiter = Instance(ZMQExitAutocall) def _exiter_default(self):