def _slashappend_or_add_error(p, caller):
 try:
  st = os.lstat(p)
 except OSError as e:
  add_error(('%s: %s' % (caller, e)))
  return None
 else:
  if stat.S_ISDIR(st.st_mode):
   return slashappend(p)
  return p

def _slashappend_or_add_error ( p , caller ) : try : st = os . lstat ( p ) except OSError as e : add_error ( ( '%s: %s' % ( caller , e ) ) ) return None else : if stat . S_ISDIR ( st . st_mode ) : return slashappend ( p ) return p
return p .