##// END OF EJS Templates
Install kernel-side sys.excepthook so we at least see kernel tracebacks.
Fernando Perez -
Show More
@@ -11,7 +11,9 b' import sys'
11 import zmq
11 import zmq
12
12
13 # Local imports.
13 # Local imports.
14 from IPython.core.ultratb import FormattedTB
14 from IPython.external.argparse import ArgumentParser
15 from IPython.external.argparse import ArgumentParser
16 from IPython.utils import io
15 from exitpoller import ExitPollerUnix, ExitPollerWindows
17 from exitpoller import ExitPollerUnix, ExitPollerWindows
16 from displayhook import DisplayHook
18 from displayhook import DisplayHook
17 from iostream import OutStream
19 from iostream import OutStream
@@ -60,22 +62,25 b' def make_kernel(namespace, kernel_factory,'
60 out_stream_factory=None, display_hook_factory=None):
62 out_stream_factory=None, display_hook_factory=None):
61 """ Creates a kernel.
63 """ Creates a kernel.
62 """
64 """
65 # Install minimal exception handling
66 sys.excepthook = FormattedTB(mode='Verbose', ostream=sys.__stdout__)
67
63 # Create a context, a session, and the kernel sockets.
68 # Create a context, a session, and the kernel sockets.
64 print >>sys.__stdout__, "Starting the kernel..."
69 io.rprint("Starting the kernel...")
65 context = zmq.Context()
70 context = zmq.Context()
66 session = Session(username=u'kernel')
71 session = Session(username=u'kernel')
67
72
68 reply_socket = context.socket(zmq.XREP)
73 reply_socket = context.socket(zmq.XREP)
69 xrep_port = bind_port(reply_socket, namespace.ip, namespace.xrep)
74 xrep_port = bind_port(reply_socket, namespace.ip, namespace.xrep)
70 print >>sys.__stdout__, "XREP Channel on port", xrep_port
75 io.rprint("XREP Channel on port", xrep_port)
71
76
72 pub_socket = context.socket(zmq.PUB)
77 pub_socket = context.socket(zmq.PUB)
73 pub_port = bind_port(pub_socket, namespace.ip, namespace.pub)
78 pub_port = bind_port(pub_socket, namespace.ip, namespace.pub)
74 print >>sys.__stdout__, "PUB Channel on port", pub_port
79 io.rprint("PUB Channel on port", pub_port)
75
80
76 req_socket = context.socket(zmq.XREQ)
81 req_socket = context.socket(zmq.XREQ)
77 req_port = bind_port(req_socket, namespace.ip, namespace.req)
82 req_port = bind_port(req_socket, namespace.ip, namespace.req)
78 print >>sys.__stdout__, "REQ Channel on port", req_port
83 io.rprint("REQ Channel on port", req_port)
79
84
80 # Redirect input streams and set a display hook.
85 # Redirect input streams and set a display hook.
81 if out_stream_factory:
86 if out_stream_factory:
General Comments 0
You need to be logged in to leave comments. Login now