Skip to content

Commit

Permalink
Merge pull request #774 from casperdcl/patch-1
Browse files Browse the repository at this point in the history
Thanks!
  • Loading branch information
neurolabusc committed Jan 3, 2024
2 parents 852e5ed + 9adc165 commit dcfdee5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dcm2niix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@
bin = str(bin_path)


def main(args=None):
def main(args=None, **run_kwargs):
"""
Arguments:
args: defaults to `sys.argv[1:]`.
**run_kwargs: passed to `subprocess.run`.
Returns: `subprocess.CompletedProcess` instance.
"""
if args is None:
import sys
args = sys.argv[1:]
from subprocess import run
run([bin] + args)
return run([bin] + args, **run_kwargs)

0 comments on commit dcfdee5

Please sign in to comment.