From 03671d8baa57a3200f024f9afac25be8f7526299 2015-06-30 22:16:56 From: Thomas Kluyver Date: 2015-06-30 22:16:56 Subject: [PATCH] Merge pull request #8594 from minrk/missing-payload allow payload to be undefined in execute_reply --- diff --git a/IPython/qt/console/frontend_widget.py b/IPython/qt/console/frontend_widget.py index cce5778..c6b3749 100644 --- a/IPython/qt/console/frontend_widget.py +++ b/IPython/qt/console/frontend_widget.py @@ -764,7 +764,7 @@ class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin): def _process_execute_ok(self, msg): """ Process a reply for a successful execution request. """ - payload = msg['content']['payload'] + payload = msg['content'].get('payload', []) for item in payload: if not self._process_execute_payload(item): warning = 'Warning: received unknown payload of type %s' diff --git a/IPython/terminal/console/interactiveshell.py b/IPython/terminal/console/interactiveshell.py index 6724da0..38e6a7c 100644 --- a/IPython/terminal/console/interactiveshell.py +++ b/IPython/terminal/console/interactiveshell.py @@ -205,7 +205,7 @@ class ZMQTerminalInteractiveShell(TerminalInteractiveShell): return elif status == 'ok': # handle payloads - for item in content["payload"]: + for item in content.get('payload', []): source = item['source'] if source == 'page': page.page(item['data']['text/plain'])