def update_contact_photo(gd_client, contact_url, media_object): contact = gd_client.GetContact(contact_url) try: gd_client.ChangePhoto(media_object, contact) except gdata.client.RequestError, e: if e.status == 412: # Etags mismatch: handle the exception. pass