Skip to content

Commit

Permalink
[rf] improve subprocess calls in compute
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-monch committed Oct 22, 2024
1 parent 96a1909 commit 6dcb271
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions datalad_remake/utils/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,10 @@ def compute(

with contextlib.chdir(root_directory):
if template.get('use_shell', 'false') == 'true':
lgr.debug(
f'compute: RUNNING: with shell=True: {" ".join([substituted_executable, *substituted_arguments])}'
)
subprocess.run(
' '.join([substituted_executable, *substituted_arguments]),
shell=True,
check=True,
) # noqa: S602
cmd = ' '.join([substituted_executable, *substituted_arguments])
lgr.debug(f'compute: RUNNING: with shell=True: {cmd}')
subprocess.run(cmd, shell=True, check=True) # noqa: S602
else:
lgr.debug(
f'compute: RUNNING: {[substituted_executable, *substituted_arguments]}'
)
subprocess.run([substituted_executable, *substituted_arguments], check=True)
cmd_list = [substituted_executable, *substituted_arguments]
lgr.debug(f'compute: RUNNING: {cmd_list}')
subprocess.run(cmd_list, check=True)

0 comments on commit 6dcb271

Please sign in to comment.