[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend: modify sort() for Python 2.3



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1248080940 -3600
# Node ID 69cd50c86a798d3717476fb94065da33320cfaa9
# Parent  ad5a697d701acdd0c78bfcec0a9478bdbf49df7c
xend: modify sort() for Python 2.3

Python 2.3 does not support the sort(cmp, key, reverse) style.

Signed-off-by: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/python/xen/util/pci.py |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r ad5a697d701a -r 69cd50c86a79 tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Mon Jul 20 10:08:12 2009 +0100
+++ b/tools/python/xen/util/pci.py      Mon Jul 20 10:09:00 2009 +0100
@@ -310,7 +310,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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.