def get(self, Q):
while self.Errors.empty():<EOL><INDENT>try:<EOL><INDENT>return Q.get(timeout=<NUM_LIT:1>)<EOL><DEDENT>except queue.Empty:<EOL><INDENT>if not self.is_alive():<EOL><INDENT>try:<EOL><INDENT>return Q.get(timeout=<NUM_LIT:0>)<EOL><DEDENT>except queue.Empty:<EOL><INDENT>raise StopProcessGroup<EOL><DEDENT><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise StopProcessGroup<EOL><DEDENT>
Protected get. Get an item from Q.
            Will block. but if the process group has errors,
            raise an StopProcessGroup exception.

            A slave process will terminate upon StopProcessGroup.
            The master process shall read the error from the process group.