Skip to content

Commit

Permalink
Add double quotes to script args in rerun screen message when using v…
Browse files Browse the repository at this point in the history
…prof profiling (#897)

* include script args in quotes for vprof

* actual fixing the problem at hand not faffing about
  • Loading branch information
valeriupredoi authored Dec 7, 2020
1 parent 5e91b2b commit 1edded4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion esmvalcore/_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ def _start_diagnostic_script(self, cmd, env):
rerun_msg = 'cd {}; '.format(cwd)
if env:
rerun_msg += ' '.join('{}="{}"'.format(k, env[k]) for k in env)
rerun_msg += ' ' + ' '.join(cmd)
if "vprof" in cmd:
script_args = ' "' + cmd[-1] + '"'
rerun_msg += ' ' + ' '.join(cmd[:-1]) + script_args
else:
rerun_msg += ' ' + ' '.join(cmd)
logger.info("To re-run this diagnostic script, run:\n%s", rerun_msg)

complete_env = dict(os.environ)
Expand Down

0 comments on commit 1edded4

Please sign in to comment.