From 34a4c0b0afc2e0f35e5a0f8e1768818af1dffa25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=BCmmerer?= Date: Wed, 14 Aug 2024 22:48:01 +0200 Subject: [PATCH] Still produce stack trace in case of matlab errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthias Kümmerer --- pysaliency/utils/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pysaliency/utils/__init__.py b/pysaliency/utils/__init__.py index 3852e45..38a202e 100644 --- a/pysaliency/utils/__init__.py +++ b/pysaliency/utils/__init__.py @@ -330,9 +330,9 @@ def run_matlab_cmd(cmd, cwd=None): matlab = get_matlab_or_octave() args = [] if os.path.basename(matlab).startswith('matlab'): - #args += ['-nodesktop', '-nosplash', '-r'] - #args.append("try;{};catch exc;disp(getReport(exc));disp('__ERROR__');exit(1);end;quit".format(cmd)) - args += ['-batch', cmd] + # args += ['-nodesktop', '-nosplash', '-r'] + args += ['-batch'] + args.append("try;{};catch exc;disp(getReport(exc));disp('__ERROR__');exit(1);end;quit".format(cmd)) else: args += ['--traditional', '--eval'] args.append("try;{};catch exc;struct_levels_to_print(10);print_struct_array_contents(true);disp(lasterror);for i=1:size(lasterror.stack);disp(lasterror.stack(i));end;disp('__ERROR__');exit(1);end;quit".format(cmd))