##// END OF EJS Templates
Don't die if stderr/stdout do not support set_parent() #2925...
y-p -
Show More
@@ -364,8 +364,14 b' class Kernel(Configurable):'
364 shell.displayhook.set_parent(parent)
364 shell.displayhook.set_parent(parent)
365 shell.display_pub.set_parent(parent)
365 shell.display_pub.set_parent(parent)
366 shell.data_pub.set_parent(parent)
366 shell.data_pub.set_parent(parent)
367 sys.stdout.set_parent(parent)
367 try:
368 sys.stderr.set_parent(parent)
368 sys.stdout.set_parent(parent)
369 except AttributeError:
370 pass
371 try:
372 sys.stderr.set_parent(parent)
373 except AttributeError:
374 pass
369
375
370 # Re-broadcast our input for the benefit of listening clients, and
376 # Re-broadcast our input for the benefit of listening clients, and
371 # start computing output
377 # start computing output
@@ -567,14 +573,20 b' class Kernel(Configurable):'
567 return
573 return
568
574
569 self._publish_status(u'busy', parent)
575 self._publish_status(u'busy', parent)
570
576
571 # Set the parent message of the display hook and out streams.
577 # Set the parent message of the display hook and out streams.
572 shell = self.shell
578 shell = self.shell
573 shell.displayhook.set_parent(parent)
579 shell.displayhook.set_parent(parent)
574 shell.display_pub.set_parent(parent)
580 shell.display_pub.set_parent(parent)
575 shell.data_pub.set_parent(parent)
581 shell.data_pub.set_parent(parent)
576 sys.stdout.set_parent(parent)
582 try:
577 sys.stderr.set_parent(parent)
583 sys.stdout.set_parent(parent)
584 except AttributeError:
585 pass
586 try:
587 sys.stderr.set_parent(parent)
588 except AttributeError:
589 pass
578
590
579 # pyin_msg = self.session.msg(u'pyin',{u'code':code}, parent=parent)
591 # pyin_msg = self.session.msg(u'pyin',{u'code':code}, parent=parent)
580 # self.iopub_socket.send(pyin_msg)
592 # self.iopub_socket.send(pyin_msg)
General Comments 0
You need to be logged in to leave comments. Login now