From 4de1d932e46b4418eba910753149410341708424 Mon Sep 17 00:00:00 2001 From: Tom Hampshire Date: Mon, 22 Apr 2024 07:57:31 +0100 Subject: [PATCH] Console script return status code (https://github.com/rordenlab/dcm2niix/issues/811) --- dcm2niix/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dcm2niix/__init__.py b/dcm2niix/__init__.py index 42b26c2d..91b1cb1c 100644 --- a/dcm2niix/__init__.py +++ b/dcm2niix/__init__.py @@ -24,10 +24,10 @@ def main(args=None, **run_kwargs): Arguments: args: defaults to `sys.argv[1:]`. **run_kwargs: passed to `subprocess.run`. - Returns: `subprocess.CompletedProcess` instance. + Returns: `int` exit code from dcm2niix execution. """ if args is None: import sys args = sys.argv[1:] from subprocess import run - return run([bin] + args, **run_kwargs) + return run([bin] + args, **run_kwargs).returncode