From c42828d18d8642d407fe7bf79e6a20c3ca3ecbbf 2015-01-17 01:08:22 From: Min RK Date: 2015-01-17 01:08:22 Subject: [PATCH] wait for terminal to terminate --- diff --git a/IPython/html/terminal/api_handlers.py b/IPython/html/terminal/api_handlers.py index 4c7600c..6895e71 100644 --- a/IPython/html/terminal/api_handlers.py +++ b/IPython/html/terminal/api_handlers.py @@ -1,5 +1,5 @@ import json -from tornado import web +from tornado import web, gen from ..base.handlers import IPythonHandler, json_errors from ..utils import url_path_join @@ -33,12 +33,12 @@ class TerminalHandler(IPythonHandler): @web.authenticated @json_errors + @gen.coroutine def delete(self, name): tm = self.terminal_manager if name in tm.terminals: - tm.kill(name) - # XXX: Should this wait for terminal to finish before returning? + yield tm.terminate(name, force=True) self.set_status(204) self.finish() else: - raise web.HTTPError(404, "Terminal not found: %r" % name) \ No newline at end of file + raise web.HTTPError(404, "Terminal not found: %r" % name)