From 83dc1d786ca837ffbd997dc7640f66fa4f9557fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 9 Oct 2019 10:59:13 +0200 Subject: [PATCH] tools: fix GYP MSVS solution generator for Python 3 --- tools/gyp/pylib/gyp/MSVSNew.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/gyp/pylib/gyp/MSVSNew.py b/tools/gyp/pylib/gyp/MSVSNew.py index 9b64e2c1c80601..740ef2c73fa71b 100644 --- a/tools/gyp/pylib/gyp/MSVSNew.py +++ b/tools/gyp/pylib/gyp/MSVSNew.py @@ -7,6 +7,7 @@ import hashlib import os import random +from operator import attrgetter import gyp.common @@ -86,7 +87,7 @@ def __init__(self, path, name = None, entries = None, self.guid = guid # Copy passed lists (or set to empty lists) - self.entries = sorted(list(entries or [])) + self.entries = sorted(entries or [], key=attrgetter('path')) self.items = list(items or []) self.entry_type_guid = ENTRY_TYPE_GUIDS['folder'] @@ -230,7 +231,7 @@ def Write(self, writer=gyp.common.WriteOnDiff): if isinstance(e, MSVSFolder): entries_to_check += e.entries - all_entries = sorted(all_entries) + all_entries = sorted(all_entries, key=attrgetter('path')) # Open file and print header f = writer(self.path)