##// END OF EJS Templates
flush stdout/stderr on displayhook...
MinRK -
Show More
@@ -1,4 +1,5 b''
1 import __builtin__
1 import __builtin__
2 import sys
2 from base64 import encodestring
3 from base64 import encodestring
3
4
4 from IPython.core.displayhook import DisplayHook
5 from IPython.core.displayhook import DisplayHook
@@ -20,6 +21,8 b' class ZMQDisplayHook(object):'
20 return
21 return
21
22
22 __builtin__._ = obj
23 __builtin__._ = obj
24 sys.stdout.flush()
25 sys.stderr.flush()
23 msg = self.session.send(self.pub_socket, u'pyout', {u'data':repr(obj)},
26 msg = self.session.send(self.pub_socket, u'pyout', {u'data':repr(obj)},
24 parent=self.parent_header, ident=self.topic)
27 parent=self.parent_header, ident=self.topic)
25
28
@@ -63,6 +66,8 b' class ZMQShellDisplayHook(DisplayHook):'
63
66
64 def finish_displayhook(self):
67 def finish_displayhook(self):
65 """Finish up all displayhook activities."""
68 """Finish up all displayhook activities."""
69 sys.stdout.flush()
70 sys.stderr.flush()
66 self.session.send(self.pub_socket, self.msg)
71 self.session.send(self.pub_socket, self.msg)
67 self.msg = None
72 self.msg = None
68
73
General Comments 0
You need to be logged in to leave comments. Login now