def block(self):
if self._uses_subprocess:<EOL><INDENT>if self.blocking:<EOL><INDENT>try:<EOL><INDENT>stdout, stderr = self.subprocess.communicate()<EOL>self.__out = stdout<EOL>self.__err = stderr<EOL><DEDENT>except ValueError:<EOL><INDENT>pass  <EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.subprocess.stdin.close()<EOL>self.std_out.close()<EOL>self.std_err.close()<EOL>self.subprocess.wait()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.subprocess.sendeof()<EOL>try:<EOL><INDENT>self.subprocess.wait()<EOL><DEDENT>finally:<EOL><INDENT>if self.subprocess.proc.stdout:<EOL><INDENT>self.subprocess.proc.stdout.close()<EOL><DEDENT><DEDENT><DEDENT>
Blocks until process is complete.