Skip to content
Snippets Groups Projects
Commit b6769411 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Conditional in fsl.runTool which detects whether we are running as a

compiled pyinstaller executable, or as a python script.
parent 25a53678
No related branches found
No related tags found
No related merge requests found
......@@ -394,11 +394,26 @@ def runTool(toolName, args, **kwargs):
in a separate process. Returns the process exit code.
"""
args = [toolName] + args
args = [sys.executable, '-c', 'import fsl; fsl.main()'] + args
# If we are running from a compiled fsleyes
# executable, we need to prepend command line
# arguments with 'cmd' - see the wrapper script
# created by:
#
# https://git.fmrib.ox.ac.uk/paulmc/fslpy_build/\
# blob/master/build_osx_app.sh
if getattr(sys, 'frozen', False):
args = [sys.executable, 'cmd'] + args
# Otherwise we are running
# through a python interpreter
else:
args = [sys.executable, '-c', 'import fsl; fsl.main()'] + args
log.debug('Executing {}'.format(' '.join(args)))
return subprocess.call(args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment