From: gregnoel Date: Fri, 16 Apr 2010 22:01:00 +0000 (+0000) Subject: http://scons.tigris.org/issues/show_bug.cgi?id=2345 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=34ae8709360358709d1bda2a7c1cef8b8132f9e0;p=scons.git scons.tigris.org/issues/show_bug.cgi?id=2345 Quiet the rest of the 'callable' warnings and fix the rest of the 'cmp argument' warnings. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4789 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 304c35ea..e932351e 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -290,7 +290,9 @@ class _DSPGenerator: self.sources[t[0]].append(self.env[t[1]]) for n in sourcenames: - self.sources[n].sort(lambda a, b: cmp(a.lower(), b.lower())) + #TODO 2.4: compat layer supports sorted(key=) but not sort(key=) + #TODO 2.4: self.sources[n].sort(key=lambda a: a.lower()) + self.sources[n] = sorted(self.sources[n], key=lambda a: a.lower()) def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, dspfile=dspfile): config = Config() @@ -439,9 +441,7 @@ class _GenerateV6DSP(_DSPGenerator): 'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe', 'Other Files': ''} - cats = categories.keys() - cats.sort(lambda a, b: cmp(a.lower(), b.lower())) - for kind in cats: + for kind in sorted(categories.keys(), key=lambda a: a.lower()): if not self.sources[kind]: continue # skip empty groups @@ -695,8 +695,7 @@ class _GenerateV7DSP(_DSPGenerator): self.file.write(pdata + '-->\n') def printSources(self, hierarchy, commonprefix): - sorteditems = hierarchy.items() - sorteditems.sort(lambda a, b: cmp(a[0].lower(), b[0].lower())) + sorteditems = sorted(hierarchy.items(), key=lambda a: a[0].lower()) # First folders, then files for key, value in sorteditems: @@ -726,9 +725,8 @@ class _GenerateV7DSP(_DSPGenerator): self.file.write('\t\n') - cats = categories.keys() - cats.sort(lambda a, b: cmp(a.lower(), b.lower())) - cats = [k for k in cats if self.sources[k]] + cats = sorted([k for k in categories.keys() if self.sources[k]], + key=lambda a: a.lower()) for kind in cats: if len(cats) > 1: self.file.write('\t\t