From 24d3b02a407b41ef44384169fbafa00d97be9d22 2011-08-29 20:49:10 From: MinRK Date: 2011-08-29 20:49:10 Subject: [PATCH] Don't assume history request succeeded errors in startup can cause the history request to be aborted. There could be any of a number of reasons the history request should fail, and the frontend should *never* assume that the status is 'ok'. --- diff --git a/IPython/frontend/qt/console/ipython_widget.py b/IPython/frontend/qt/console/ipython_widget.py index 29b796a..abb7c28 100644 --- a/IPython/frontend/qt/console/ipython_widget.py +++ b/IPython/frontend/qt/console/ipython_widget.py @@ -174,7 +174,11 @@ class IPythonWidget(FrontendWidget): """ Implemented to handle history tail replies, which are only supported by the IPython kernel. """ - history_items = msg['content']['history'] + content = msg['content'] + if 'history' not in content: + self.log.error("History request failed: %r"%content) + return + history_items = content['history'] items = [ line.rstrip() for _, _, line in history_items ] self._set_history(items)