[Python-checkins] r65438 - python/trunk/Lib/cookielib.py

brett.cannon python-checkins at python.org
Mon Aug 4 00:34:26 CEST 2008


Author: brett.cannon
Date: Mon Aug  4 00:34:25 2008
New Revision: 65438

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


Modified:
   python/trunk/Lib/cookielib.py

Modified: python/trunk/Lib/cookielib.py
==============================================================================
--- python/trunk/Lib/cookielib.py	(original)
+++ python/trunk/Lib/cookielib.py	Mon Aug  4 00:34:25 2008
@@ -1258,8 +1258,7 @@
 
         """
         # 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
 


More information about the Python-checkins mailing list