From 361e7f97d039ac2e8f6391b95c588cb30feb5cf6 2011-11-21 19:20:58 From: MinRK Date: 2011-11-21 19:20:58 Subject: [PATCH] associate messages with no parent to all qt frontends The only messages that should have no parent are print statements made prior to the first execution. The principal example of this is the pylab welcome message. --- diff --git a/IPython/frontend/qt/base_frontend_mixin.py b/IPython/frontend/qt/base_frontend_mixin.py index f59fd50..697d45f 100644 --- a/IPython/frontend/qt/base_frontend_mixin.py +++ b/IPython/frontend/qt/base_frontend_mixin.py @@ -106,4 +106,9 @@ class BaseFrontendMixin(object): from this frontend. """ session = self._kernel_manager.session.session - return msg['parent_header']['session'] == session + parent = msg['parent_header'] + if not parent: + # if the message has no parent, assume it is meant for all frontends + return True + else: + return parent.get('session') == session