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 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: modify sort() for Python 2.3
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Jul 2009 04:45:35 -0700
Delivery-date: Mon, 20 Jul 2009 04:46:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: modify sort() for Python 2.3, Xen patchbot-unstable <=