def st_mode_to_octal(mode):
 try:
  return oct(mode)[(-4):]
 except (TypeError, IndexError):
  return ''

def st_mode_to_octal ( mode ) : try : return oct ( mode ) [ ( - 4 ) : ] except ( TypeError , IndexError ) : return ''
convert the st_mode value from a stat(2) call (as returned from os .