def convert_perm(perm):
 if isinstance(perm, six.integer_types):
  perm = six.text_type(perm)
 return int(perm, 8)

def convert_perm ( perm ) : if isinstance ( perm , six . integer_types ) : perm = six . text_type ( perm ) return int ( perm , 8 )
convert a string to an integer .