From: "KUWAMURA Shin'ya" Subject: [PATCH] xend: modify sort() for Python 2.3 Date: Fri, 17 Jul 2009 16:41:11 +0900 (JST) Message-ID: <20090717.164111.263300635.kuwa@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Jul_17_16_41_11_2009_806)--" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ----Next_Part(Fri_Jul_17_16_41_11_2009_806)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Python 2.3 do not support the sort(cmp, key, reverse) style. Signed-off-by: KUWAMURA Shin'ya -- KUWAMURA Shin'ya ----Next_Part(Fri_Jul_17_16_41_11_2009_806)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xend-modify-sort.patch" # HG changeset patch # User KUWAMURA Shin'ya # Date 1247805279 -32400 # Node ID 8c52a43e7385a344619644148d930d1eabc0068c # Parent 3d7be8ff7ad9e48cdd08517a8303e86f0090522b xend: modify sort() for Python 2.3 Python 2.3 do not support the sort(cmp, key, reverse) style. Signed-off-by: KUWAMURA Shin'ya diff -r 3d7be8ff7ad9 -r 8c52a43e7385 tools/python/xen/util/pci.py --- a/tools/python/xen/util/pci.py Fri Jul 17 13:22:03 2009 +0900 +++ b/tools/python/xen/util/pci.py Fri Jul 17 13:34:39 2009 +0900 @@ -307,7 +307,7 @@ def parse_pci_name_extended(pci_dev_str) # By arranging things so that virtual function 0 is first, # attachemnt can use the returned list as is. And detachment # can just reverse the list. - pci.sort(None, lambda x: int(x['vdevfn'], 16), 1) + pci.sort(lambda x,y: cmp(int(y['vdevfn'], 16), int(x['vdevfn'], 16))) return pci def parse_pci_name(pci_name_string): ----Next_Part(Fri_Jul_17_16_41_11_2009_806)-- Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ----Next_Part(Fri_Jul_17_16_41_11_2009_806)----