#NEWLINE# def to_brig( self , mod , opt = 3 ) : #NEWLINE# #INDENT# bufptr = c_void_p ( 0 ) #NEWLINE# size = self . hlc . HLC_ModuleEmitBRIG ( mod , int ( opt ) , byref ( bufptr ) ) #NEWLINE# if ( not size ) : #NEWLINE# #INDENT# raise Error ( 'Failed to emit BRIG' ) #NEWLINE# #UNINDENT# buf = ( c_byte * size ) . from_address ( mod . value ) #NEWLINE# try : #NEWLINE# #INDENT# buffer #NEWLINE# #UNINDENT# except NameError : #NEWLINE# #INDENT# ret = bytes ( buf ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret = bytes ( buffer ( buf ) ) #NEWLINE# #UNINDENT# self . hlc . HLC_DisposeString ( buf ) #NEWLINE# return ret