]> granicus.if.org Git - python/commitdiff
Remove a use of list.sort(cmp=) to silence a -3 DeprecationWarning in
authorBrett Cannon <bcannon@gmail.com>
Sun, 3 Aug 2008 22:34:25 +0000 (22:34 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 3 Aug 2008 22:34:25 +0000 (22:34 +0000)
cookielib.

Lib/cookielib.py

index b27f63caf162552b6560ea8ae9b2c2518e36d334..9439b5c295b9bd7f8cd2e7ce95735e326f3c642a 100644 (file)
@@ -1258,8 +1258,7 @@ class CookieJar:
 
         """
         # add cookies in order of most specific (ie. longest) path first
-        def decreasing_size(a, b): return cmp(len(b.path), len(a.path))
-        cookies.sort(decreasing_size)
+        cookies.sort(key=lambda arg: len(arg.path), reverse=True)
 
         version_set = False