def _SudoExec(self, argv, expect_rc=None):
    """Run an argv list with sudo.

    Args:
      argv: list, arguments to exec, argv[0] is binary
      expect_rc: int, optional, expected return code from exec
    Returns:
      (str stdout output, str stderr output)
    Raises:
      SudoExecError: if an expect_* condition was not met
    """
    # NOTE(user): sudo 1.6.8p12 on OS X 10.5.8 doesn't understand the '--'
    # argument to stop parsing args.  Instead we do this evilness to enforce
    # a fully qualified command as first arg, which will clue sudo in to
    # pass the rest of args to the called program.
    if not argv[0].startswith('/'):
      raise SudoExecError(
          'First argument must have absolute path to run: %s' % argv[0])

    _argv = ['/usr/bin/sudo']  # better would be [sudo, '--']
    _argv.extend(argv)

    logging.info('Executing sudo: %s', ' '.join(_argv))
    p = subprocess.Popen(
        _argv, shell=False,
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (stdout, stderr) = p.communicate()
    rc = p.wait()

    if expect_rc is not None:
      if rc != expect_rc:
        raise SudoExecError(
            (_argv, rc, expect_rc) % 'Sudo exec %s: rc %d != %d')

    return (stdout, stderr)
dataset/ETHPy150Open google/simian/src/simian/client/client.py/HttpsAuthClient._SudoExec/swapped operands of `%`