##// 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
69 try:
68 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
General Comments 0
You need to be logged in to leave comments. Login now