From ead8b8f877216e2570f8a3ba85538c3ad48682d2 2011-12-11 23:59:39 From: MinRK Date: 2011-12-11 23:59:39 Subject: [PATCH] allow IPython.zmq.completer to be imported without readline Allows ipengine to start on Windows without pyreadline present --- diff --git a/IPython/zmq/completer.py b/IPython/zmq/completer.py index b775b8a..a5f3192 100644 --- a/IPython/zmq/completer.py +++ b/IPython/zmq/completer.py @@ -5,7 +5,10 @@ from __future__ import print_function import itertools -import readline +try: + import readline +except ImportError: + readline = None import rlcompleter import time @@ -37,8 +40,9 @@ class ClientCompleter(object): and then return them for each value of state.""" def __init__(self, client, session, socket): - # ugly, but we get called asynchronously and need access to some - # client state, like backgrounded code + # ugly, but we get called asynchronously and need access to some + # client state, like backgrounded code + assert readline is not None, "ClientCompleter depends on readline" self.client = client self.session = session self.socket = socket