##// END OF EJS Templates
Pass Windows interrupt event to kernels as an environment variable...
Thomas Kluyver -
Show More
@@ -174,6 +174,8 b' def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, env=None,'
174 else:
174 else:
175 _stdout, _stderr = stdout, stderr
175 _stdout, _stderr = stdout, stderr
176
176
177 env = env if (env is not None) else os.environ.copy()
178
177 encoding = getdefaultencoding(prefer_stream=False)
179 encoding = getdefaultencoding(prefer_stream=False)
178
180
179 # Spawn a kernel.
181 # Spawn a kernel.
@@ -186,6 +188,9 b' def launch_kernel(cmd, stdin=None, stdout=None, stderr=None, env=None,'
186 from IPython.kernel.zmq.parentpoller import ParentPollerWindows
188 from IPython.kernel.zmq.parentpoller import ParentPollerWindows
187 # Create a Win32 event for interrupting the kernel.
189 # Create a Win32 event for interrupting the kernel.
188 interrupt_event = ParentPollerWindows.create_interrupt_event()
190 interrupt_event = ParentPollerWindows.create_interrupt_event()
191 # Store this in an environment variable for third party kernels, but at
192 # present, our own kernel expects this as a command line argument.
193 env["IPY_INTERRUPT_EVENT"] = str(interrupt_event)
189 if ipython_kernel:
194 if ipython_kernel:
190 cmd += [ '--interrupt=%i' % interrupt_event ]
195 cmd += [ '--interrupt=%i' % interrupt_event ]
191
196
General Comments 0
You need to be logged in to leave comments. Login now