def _attachment_sequence(attachments):
 if ((len(attachments) == 2) and isinstance(attachments[0], basestring)):
  return (attachments,)
 return attachments

def _attachment_sequence ( attachments ) : if ( ( len ( attachments ) == 2 ) and isinstance ( attachments [ 0 ] , basestring ) ) : return ( attachments , ) return attachments
forces attachments to be sequenceable type .