code: def run_checked (cmd, ret_ok=(0,), **kwargs):
      
      retcode = run(cmd, **kwargs)
      if retcode not in ret_ok:
          msg = "Command `%s' returned non-zero exit status %d" % (cmd, retcode)
          raise PatoolError(msg)
      return retcode
docs: Run command and raise PatoolError on error.