#NEWLINE# def _getPython2ExePathWindows( ) : #NEWLINE# #INDENT# if os . path . isfile ( 'c:\\Python27\\python.exe' ) : #NEWLINE# #INDENT# return 'c:\\Python27\\python.exe' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if os . path . isfile ( 'c:\\Python26\\python.exe' ) : #NEWLINE# #INDENT# return 'c:\\Python26\\python.exe' #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# import _winreg as winreg #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# import winreg #NEWLINE# #UNINDENT# for search in ( '2.7' , '2.6' ) : #NEWLINE# #INDENT# for hkey_branch in ( winreg . HKEY_LOCAL_MACHINE , winreg . HKEY_CURRENT_USER ) : #NEWLINE# #INDENT# for arch_key in ( 0 , winreg . KEY_WOW64_32KEY , winreg . KEY_WOW64_64KEY ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# key = winreg . OpenKey ( hkey_branch , ( 'SOFTWARE\\Python\\PythonCore\\%s\\InstallPath' % search ) , 0 , ( winreg . KEY_READ | arch_key ) ) #NEWLINE# return Utils . joinpath ( winreg . QueryValue ( key , '' ) , 'python.exe' ) #NEWLINE# #UNINDENT# except WindowsError : #NEWLINE# #INDENT# pass