#NEWLINE# def detect_ninja( ) : #NEWLINE# #INDENT# for n in [ 'ninja' , 'ninja-build' ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# p = subprocess . Popen ( [ n , '--version' ] , stdout = subprocess . DEVNULL , stderr = subprocess . DEVNULL ) #NEWLINE# #UNINDENT# except FileNotFoundError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# p . communicate ( ) #NEWLINE# if ( n . returncode == 0 ) : #NEWLINE# #INDENT# return n