def _safe_getattr(obj, attr, default=None):
 try:
  return getattr(obj, attr, default)
 except Exception:
  return default

def _safe_getattr ( obj , attr , default = None ) : try : return getattr ( obj , attr , default ) except Exception : return default
safe version of getattr .