Handle vswhere output encodings in Python2 #1965

This commit is contained in:
Thomas Nagy 2017-05-13 09:53:49 +02:00
parent 86134af9fb
commit 07c47309de
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
1 changed files with 2 additions and 0 deletions

View File

@ -456,6 +456,8 @@ def gather_vswhere_versions(conf, versions):
Logs.debug('msvc: vswhere.exe failed %s', e)
return
if sys.version_info[0] < 3:
txt = txt.decode(sys.stdout.encoding or 'windows-1252')
arr = json.loads(txt)
arr.sort(key=lambda x: x['installationVersion'])
for entry in arr: