Skip to content

Commit d472236

Browse files
author
Michele Mesiti
committed
parse last token of return output instead of 1st
fixes #151
1 parent f07a743 commit d472236

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bash_kernel/kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def do_execute(self, code, silent, store_history=True,
224224
return {'status': 'abort', 'execution_count': self.execution_count}
225225

226226
try:
227-
exitcode = int(self.bashwrapper.run_command('{ echo $?; } 2>/dev/null').rstrip().split("\r\n")[0])
227+
exitcode = int(self.bashwrapper.run_command('{ echo $?; } 2>/dev/null').rstrip().split("\r\n")[-1])
228228
except Exception as exc:
229229
exitcode = 1
230230

0 commit comments

Comments
 (0)