diff --git a/changelog.md b/changelog.md index 405ad6b..60edc8d 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,11 @@ ## x.y.z +## 2.2.6 + +FIXED: +- subprocess : None value can be returned as returncode. Need to wait for process stop in this case + ## 2.2.5 CHANGED: diff --git a/r2gg/_subprocess_execution.py b/r2gg/_subprocess_execution.py index d2817b5..84e26ac 100644 --- a/r2gg/_subprocess_execution.py +++ b/r2gg/_subprocess_execution.py @@ -33,9 +33,12 @@ def subprocess_execution(args, logger, outfile = None): process_output, _ = process.communicate() logger.info(process_output.decode("utf-8")) - returncode = process.returncode + # Wait for process stop + while process.returncode is None: + process.wait() + if process.returncode != 0: - error_msg = f"Invalid returncode {returncode} for subprocess '{subprocess_arg}'" + error_msg = f"Invalid returncode {process.returncode} for subprocess '{subprocess_arg}'" logger.error(error_msg) raise RuntimeError(error_msg)