8686# Supports replacement of one environment variable in path eg.: %ENV_KEY%.
8787PYTHON_SEARCH_PATHS = dict (
8888 WINDOWS = [
89- "C:\\ Python*\\ " ,
89+ "C:\\ Python?? *\\ " ,
9090 "C:\\ Pythons\\ Python*\\ " ,
9191 "%LOCALAPPDATA%\\ Programs\\ Python\\ Python*\\ " ,
9292 "C:\\ Program Files\\ Python*\\ " ,
@@ -277,6 +277,8 @@ def search_for_pythons(search_arch):
277277 version_str = subprocess .check_output ([python , "-c" ,
278278 version_code ])
279279 version_str = version_str .strip ()
280+ if sys .version_info >= (3 , 0 ):
281+ version_str = version_str .decode ("utf-8" )
280282 match = re .search ("^\((\d+), (\d+), (\d+)\)$" , version_str )
281283 assert match , version_str
282284 major = match .group (1 )
@@ -288,6 +290,8 @@ def search_for_pythons(search_arch):
288290 "print(str(platform.architecture()[0]));" )
289291 arch = subprocess .check_output ([python , "-c" , arch_code ])
290292 arch = arch .strip ()
293+ if sys .version_info >= (3 , 0 ):
294+ arch = arch .decode ("utf-8" )
291295 if version_tuple2 in SUPPORTED_PYTHON_VERSIONS \
292296 and arch == search_arch :
293297 name = ("Python {major}.{minor}.{micro} {arch}"
0 commit comments