Skip to contentSkip to conversation

xend: modify sort() for Python 2.3

PATCH In review KUWAMURA Shin'ya 2 participants 2 messages Jul 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xend: modify sort() for Python 2.3

Hi,

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

Signature · 1 line
  KUWAMURA Shin'ya

# HG changeset patch
# User KUWAMURA Shin'ya <[email protected]> # 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.

tools/python/xen/util/pci.py +1 -1
diff -r 3d7be8ff7ad9 -r 8c52a43e7385 tools/python/xen/util/pci.py
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

Acked-by on v1 1/1
#1 lore raw

KUWAMURA Shin'ya writes ("[Xen-devel] [PATCH] xend: modify sort() for Python 2.3"):

Quoted 1 line

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

Again, this is a reasonable change, although I haven't tested it.

Ian.