Skip to content

Commit

Permalink
Merge pull request #272 from juaml/fix/check-fsl
Browse files Browse the repository at this point in the history
[FIX]: Fix `_check_fsl()`
  • Loading branch information
synchon authored Nov 7, 2023
2 parents f203cd8 + d3e69af commit 124c175
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changes/newsfragments/272.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use 1 instead of 0 for successful FSL commands in ``_check_fsl()`` by `Synchon Mandal`_
8 changes: 5 additions & 3 deletions junifer/pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ def _check_fsl(commands: Optional[List[str]] = None) -> bool:
"""
completed_process = subprocess.run(
"flirt -v",
"flirt",
stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
shell=True, # is unsafe but kept for resolution via PATH
check=False,
)
fsl_found = completed_process.returncode == 0
fsl_found = completed_process.returncode == 1

# Check for specific commands
if fsl_found and commands is not None:
Expand All @@ -155,7 +155,9 @@ def _check_fsl(commands: Optional[List[str]] = None) -> bool:
shell=True, # is unsafe but kept for resolution via PATH
check=False,
)
command_found = command_process.returncode == 0
# FSL commands are incoherent with respect to status code hence a
# blanket to only look for no command found
command_found = command_process.returncode != 127
commands_found_results[command] = (
"found" if command_found else "not found"
)
Expand Down

0 comments on commit 124c175

Please # to comment.