##// END OF EJS Templates
survive failure to bind to localhost in zmq.iostream...
MinRK -
Show More
@@ -20,6 +20,7 b' from .session import extract_header'
20 20
21 21 from IPython.utils import py3compat
22 22 from IPython.utils.py3compat import unicode_type
23 from IPython.utils.warn import warn
23 24
24 25 #-----------------------------------------------------------------------------
25 26 # Globals
@@ -65,7 +66,16 b' class OutStream(object):'
65 66
66 67 self._pipe_in = ctx.socket(zmq.PULL)
67 68 self._pipe_in.linger = 0
68 self._pipe_port = self._pipe_in.bind_to_random_port("tcp://127.0.0.1")
69 try:
70 self._pipe_port = self._pipe_in.bind_to_random_port("tcp://127.0.0.1")
71 except zmq.ZMQError as e:
72 warn("Couldn't bind IOStream to 127.0.0.1: %s" % e +
73 "\nsubprocess output will be unavailable."
74 )
75 self._pipe_flag = False
76 self._pipe_in.close()
77 del self._pipe_in
78 return
69 79 self._pipe_poller = zmq.Poller()
70 80 self._pipe_poller.register(self._pipe_in, zmq.POLLIN)
71 81
@@ -89,7 +99,7 b' class OutStream(object):'
89 99 def _check_mp_mode(self):
90 100 """check for forks, and switch to zmq pipeline if necessary"""
91 101 if not self._pipe_flag or self._is_master_process():
92 return MASTER
102 return MASTER
93 103 else:
94 104 if not self._have_pipe_out():
95 105 self._flush_buffer()
General Comments 0
You need to be logged in to leave comments. Login now