def _SetAclXmlPassthrough(self, url, gsutil_api):
    try:
      orig_prefer_api = gsutil_api.prefer_api
      gsutil_api.prefer_api = ApiSelector.XML
      gsutil_api.XmlPassThroughSetAcl(
          self.acl_arg, url, canned=self.canned,
          def_obj_acl=self.def_acl, provider=url.scheme)
    except ServiceException as e:
      if self.continue_on_error:
        self.everything_set_okay = False
        self.logger.error(e)
      else:
        raise
    finally:
      gsutil_api.prefer_api = orig_prefer_api
Helper method for _walk, works similarly to os.walk.
dataset/ETHPy150Open GoogleCloudPlatform/gsutil/gslib/command.py/Command._SetAclXmlPassthrough--crossover with--dataset/ETHPy150Open pantsbuild/pants/src/python/pants/base/scm_project_tree.py/ScmProjectTree._do_walk