diff --git a/IPython/kernel/zmq/zmqshell.py b/IPython/kernel/zmq/zmqshell.py index 9a5f38c..c2d044b 100644 --- a/IPython/kernel/zmq/zmqshell.py +++ b/IPython/kernel/zmq/zmqshell.py @@ -501,6 +501,9 @@ class ZMQInteractiveShell(InteractiveShell): self.payload_manager.write_payload(payload) def _showtraceback(self, etype, evalue, stb): + # try to preserve ordering of tracebacks and print statements + sys.stdout.flush() + sys.stderr.flush() exc_content = { u'traceback' : stb,