[meld] Remove use of deprecated cmp keyword to sort



commit de5f43a936b85d616d3a9f6114924b302446621f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 27 13:12:38 2012 +1000

    Remove use of deprecated cmp keyword to sort

 meld/vc/__init__.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/meld/vc/__init__.py b/meld/vc/__init__.py
index 47ac860..f9c07c8 100644
--- a/meld/vc/__init__.py
+++ b/meld/vc/__init__.py
@@ -91,9 +91,8 @@ def get_vcs(location):
         # No plugin recognized that location, fallback to _null
         return [_null.Vc(location)]
 
-    vc_comp = lambda a, b: cmp(vc_sort_order.index(a), vc_sort_order.index(b))
-    vc_name = lambda x: x.NAME
-    vcs.sort(cmp=vc_comp, key=vc_name)
+    vc_sort_key = lambda v: vc_sort_order.index(v.NAME)
+    vcs.sort(key=vc_sort_key)
 
     # Simplistic hack so that we don't offer both 1.7 and <1.6 SVN
     vc_names = [plugin.NAME for plugin in vcs]



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