From 7e86b5c3ce3aa6433a57cd62bc0743052186fe1a Mon Sep 17 00:00:00 2001 From: Joel Armstrong Date: Fri, 1 Jun 2018 03:03:46 -0700 Subject: [PATCH] Fix a crash when --verbose was used (#71) --verbose makes stderr get passed through rather than being piped to cwltest. But in that case Popen.communicate() will return None in place of the stderr data. --- cwltest/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cwltest/__init__.py b/cwltest/__init__.py index 895e897..83d63b4 100755 --- a/cwltest/__init__.py +++ b/cwltest/__init__.py @@ -113,7 +113,7 @@ def run_test(args, # type: argparse.Namespace start_time = time.time() stderr = subprocess.PIPE if not args.verbose else None process = subprocess.Popen(test_command, stdout=subprocess.PIPE, stderr=stderr) - outstr, outerr = [var.decode('utf-8') for var in process.communicate(timeout=timeout)] + outstr, outerr = [(var or b'').decode('utf-8') for var in process.communicate(timeout=timeout)] return_code = process.poll() duration = time.time() - start_time if return_code: