Merge pull request #45 from drennalls/master
do_execute not sending error response on failure
This commit is contained in:
@@ -103,8 +103,12 @@ class BashKernel(Kernel):
|
|||||||
exitcode = 1
|
exitcode = 1
|
||||||
|
|
||||||
if exitcode:
|
if exitcode:
|
||||||
return {'status': 'error', 'execution_count': self.execution_count,
|
error_content = {'execution_count': self.execution_count,
|
||||||
'ename': '', 'evalue': str(exitcode), 'traceback': []}
|
'ename': '', 'evalue': str(exitcode), 'traceback': []}
|
||||||
|
|
||||||
|
self.send_response(self.iopub_socket, 'error', error_content)
|
||||||
|
error_content['status'] = 'error'
|
||||||
|
return error_content
|
||||||
else:
|
else:
|
||||||
return {'status': 'ok', 'execution_count': self.execution_count,
|
return {'status': 'ok', 'execution_count': self.execution_count,
|
||||||
'payload': [], 'user_expressions': {}}
|
'payload': [], 'user_expressions': {}}
|
||||||
@@ -138,7 +142,7 @@ class BashKernel(Kernel):
|
|||||||
cmd = 'compgen -cdfa %s' % token
|
cmd = 'compgen -cdfa %s' % token
|
||||||
output = self.bashwrapper.run_command(cmd).rstrip()
|
output = self.bashwrapper.run_command(cmd).rstrip()
|
||||||
matches.extend(output.split())
|
matches.extend(output.split())
|
||||||
|
|
||||||
if not matches:
|
if not matches:
|
||||||
return default
|
return default
|
||||||
matches = [m for m in matches if m.startswith(token)]
|
matches = [m for m in matches if m.startswith(token)]
|
||||||
|
|||||||
Reference in New Issue
Block a user