diff --git a/IPython/extensions/octavemagic.py b/IPython/extensions/octavemagic.py index ddae434..3f60ebd 100644 --- a/IPython/extensions/octavemagic.py +++ b/IPython/extensions/octavemagic.py @@ -271,9 +271,12 @@ class OctaveMagics(Magics): close all; clear ans; + + # ______ # ''' post_call = ''' + # ______ # # Save output of the last execution if exist("ans") == 1 @@ -296,9 +299,12 @@ class OctaveMagics(Magics): try: text_output = self._oct.run(code, verbose=False) except (oct2py.Oct2PyError) as exception: + msg = exception.message + msg = msg.split('# ______ #')[1] + msg = msg.split('# ______ #')[0] raise OctaveMagicError('Octave could not complete execution. ' 'Traceback (currently broken in oct2py): %s' - % exception.message) + % msg) key = 'OctaveMagic.Octave' display_data = []