+ def subprocess_wait(self, subprocess_uuid, check_return=True):
+ process = self.__subprocess[subprocess_uuid]
+ process.wait()
+ stdout, stderr = self.__stdout_stderr[subprocess_uuid]
+ stdout.close()
+ stderr.close()
+ if check_return:
+ if process.returncode != 0:
+ raise subprocess.CalledProcessError(process.returncode, process.args)
+ return process
+