def _check(self, mode=None):
if self.closed:<EOL><INDENT>raise IOError("<STR_LIT>" % self.__class__.__name__)<EOL><DEDENT>if mode is not None and self.mode not in mode:<EOL><INDENT>raise IOError("<STR_LIT>" % self.mode)<EOL><DEDENT>
Check if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.