From: Brett Cannon <bcannon@gmail.com>
Date: Sun, 3 Aug 2008 22:34:25 +0000 (+0000)
Subject: Remove a use of list.sort(cmp=) to silence a -3 DeprecationWarning in
X-Git-Tag: v2.6b3~163
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52f03c5d20426abfd1105cc8b3f9408dddab0b13;p=python

Remove a use of list.sort(cmp=) to silence a -3 DeprecationWarning in
cookielib.
---

diff --git a/Lib/cookielib.py b/Lib/cookielib.py
index b27f63caf1..9439b5c295 100644
--- a/Lib/cookielib.py
+++ b/Lib/cookielib.py
@@ -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