##// END OF EJS Templates
Simplify KernelManager.cleanup()
Thomas Kluyver -
Show More
@@ -275,14 +275,12 class KernelManager(LoggingConfigurable, ConnectionFileMixin):
275 if self.has_kernel:
275 if self.has_kernel:
276 self._kill_kernel()
276 self._kill_kernel()
277
277
278 def cleanup(self, restart=False):
278 def cleanup(self, connection_file=True):
279 """Clean up resources when the kernel is shut down"""
279 """Clean up resources when the kernel is shut down"""
280 if not restart:
280 if connection_file:
281 self.cleanup_connection_file()
281 self.cleanup_connection_file()
282 self.cleanup_ipc_files()
283 else:
284 self.cleanup_ipc_files()
285
282
283 self.cleanup_ipc_files()
286 self._close_control_socket()
284 self._close_control_socket()
287
285
288 def shutdown_kernel(self, now=False, restart=False):
286 def shutdown_kernel(self, now=False, restart=False):
@@ -315,7 +313,7 class KernelManager(LoggingConfigurable, ConnectionFileMixin):
315 # most 1s, checking every 0.1s.
313 # most 1s, checking every 0.1s.
316 self.wait_shutdown()
314 self.wait_shutdown()
317
315
318 self.cleanup(restart=restart)
316 self.cleanup(connection_file=not restart)
319
317
320 def restart_kernel(self, now=False, **kw):
318 def restart_kernel(self, now=False, **kw):
321 """Restarts a kernel with the arguments that were used to launch it.
319 """Restarts a kernel with the arguments that were used to launch it.
General Comments 0
You need to be logged in to leave comments. Login now