Skip to content

Commit

Permalink
Fix a crash when --verbose was used (#71)
Browse files Browse the repository at this point in the history
--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.
  • Loading branch information
joelarmstrong authored and mr-c committed Jun 1, 2018
1 parent 4b02ff9 commit 7e86b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cwltest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7e86b5c

Please sign in to comment.