diff --git a/IPython/frontend/qt/console/ipython_widget.py b/IPython/frontend/qt/console/ipython_widget.py index 04490d6..dcf1237 100644 --- a/IPython/frontend/qt/console/ipython_widget.py +++ b/IPython/frontend/qt/console/ipython_widget.py @@ -214,7 +214,7 @@ class IPythonWidget(FrontendWidget): self.log.debug("pyout: %s", msg.get('content', '')) if not self._hidden and self._is_from_this_session(msg): content = msg['content'] - prompt_number = content['execution_count'] + prompt_number = content.get('execution_count',0) data = content['data'] if data.has_key('text/html'): self._append_plain_text(self.output_sep, True) diff --git a/IPython/frontend/qt/console/rich_ipython_widget.py b/IPython/frontend/qt/console/rich_ipython_widget.py index 1166fe6..1a83c47 100644 --- a/IPython/frontend/qt/console/rich_ipython_widget.py +++ b/IPython/frontend/qt/console/rich_ipython_widget.py @@ -71,7 +71,7 @@ class RichIPythonWidget(IPythonWidget): """ if not self._hidden and self._is_from_this_session(msg): content = msg['content'] - prompt_number = content['execution_count'] + prompt_number = content.get('execution_count',0) data = content['data'] if data.has_key('image/svg+xml'): self.log.debug("pyout: %s", msg.get('content', ''))