#NEWLINE# def detect_cs_compiler( self ) : #NEWLINE# #INDENT# exelist = [ 'mcs' ] #NEWLINE# try : #NEWLINE# #INDENT# p = subprocess . Popen ( ( exelist + [ '--version' ] ) , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# raise EnvironmentException ( ( 'Could not execute C# compiler "%s"' % ' ' . join ( exelist ) ) ) #NEWLINE# #UNINDENT# ( out , err ) = p . communicate ( ) #NEWLINE# out = out . decode ( errors = 'ignore' ) #NEWLINE# err = err . decode ( errors = 'ignore' ) #NEWLINE# vmatch = re . search ( Environment . version_regex , out ) #NEWLINE# if vmatch : #NEWLINE# #INDENT# version = vmatch . group ( 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# version = 'unknown version' #NEWLINE# #UNINDENT# if ( 'Mono' in out ) : #NEWLINE# #INDENT# return MonoCompiler ( exelist , version ) #NEWLINE# #UNINDENT# raise EnvironmentException ( ( ( 'Unknown compiler "' + ' ' . join ( exelist ) ) + '"' ) )