WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Xen

xen-devel

[Top] [All Lists]

[Xen-devel] [PATCH] xend: modify sort() for Python 2.3

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xend: modify sort() for Python 2.3
From: "KUWAMURA Shin'ya" <kuwa@xxxxxxxxxxxxxx>
Date: 2009年7月17日 16:41:11 +0900 (JST)
Delivery-date: 2009年7月17日 00:42:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,
Python 2.3 do not support the sort(cmp, key, reverse) style.
Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
-- 
 KUWAMURA Shin'ya
# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
# 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 <kuwa@xxxxxxxxxxxxxx>
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):
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: RE: [Xen-devel] d273:v3: reserved bit in page table (ec=0019) , Jiang, Yunhong
Next by Date: Re: [Xen-devel] Every page fault caused pagetable walk when using xenoprofile , Tim Deegan
Previous by Thread: [Xen-devel] [PATCH] blktap2: Remove set() for Python 2.3 , KUWAMURA Shin'ya
Next by Thread: Re: [Xen-devel] [PATCH] xend: modify sort() for Python 2.3 , Ian Jackson
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /