def TrySetAttribute(self, attribute, value):
    """ Attempt to set the attribute to the value, with a pretty try
    block around it.  """
    if attribute == 'loc':
      self.loc = self.Canonicalize(value)
    else:
      try:
        setattr(self, attribute, value)
      except __HOLE__:
        output.Warn('Unknown URL attribute: %s' % attribute)
  #end def TrySetAttribute
dataset/ETHPy150Open benoitc/restkit/doc/sitemap_gen.py/URL.TrySetAttribute