#NEWLINE# def _create_alternatives( self , msg ) : #NEWLINE# #INDENT# for ( i , ( content , mimetype ) ) in enumerate ( self . alternatives ) : #NEWLINE# #INDENT# if ( mimetype == 'text/html' ) : #NEWLINE# #INDENT# for ( filename , _ , _ ) in self . related_attachments : #NEWLINE# #INDENT# content = re . sub ( ( '(?<!cid:)%s' % re . escape ( filename ) ) , ( 'cid:%s' % filename ) , content ) #NEWLINE# #UNINDENT# self . alternatives [ i ] = ( content , mimetype ) #NEWLINE# #UNINDENT# #UNINDENT# return super ( EmailMultiRelated , self ) . _create_alternatives ( msg )