xend: modify sort() for Python 2.3
PATCH 1/1 xend: modify sort() for Python 2.3
Hi,
Python 2.3 do not support the sort(cmp, key, reverse) style.
Signed-off-by KUWAMURA Shin'ya <[email protected]>
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.
Signed-off-by KUWAMURA Shin'ya <[email protected]>
tools/python/xen/util/pci.py +1 -1
@@ -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
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.
Acked-by Ian Jackson <[email protected]>
Ian.