]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 83371,83390 via svnmerge from
authorGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 19:07:28 +0000 (19:07 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 19:07:28 +0000 (19:07 +0000)
svn+ssh://svn.python.org/python/branches/py3k

........
  r83371 | georg.brandl | 2010-07-31 23:54:24 +0200 (Sa, 31 Jul 2010) | 1 line

  #8292: Fix three instances of truth tests on return values of filter() (which is always true in Python 3).
........
  r83390 | georg.brandl | 2010-08-01 10:07:49 +0200 (So, 01 Aug 2010) | 1 line

  #8230: make Lib/test/sortperf.py run on Python 3.
........

Lib/distutils/command/sdist.py
Lib/http/server.py
Lib/platform.py
Lib/test/sortperf.py
Misc/NEWS

index bb2106120ac980fdb750f7630400af25a0613ab4..f51d72fad7589a423519fddec266fb0f6b516d82 100644 (file)
@@ -240,8 +240,7 @@ class sdist(Command):
         optional = ['test/test*.py', 'setup.cfg']
         for pattern in optional:
             files = filter(os.path.isfile, glob(pattern))
-            if files:
-                self.filelist.extend(files)
+            self.filelist.extend(files)
 
         # build_py is used to get:
         #  - python modules
index f6f788fa9c1f47f4089d582fccf0c004e084e1ac..930831cbf6ccfe1faf8f6f467b5896b53281c589 100644 (file)
@@ -1015,8 +1015,9 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
         if ua:
             env['HTTP_USER_AGENT'] = ua
         co = filter(None, self.headers.get_all('cookie', []))
-        if co:
-            env['HTTP_COOKIE'] = ', '.join(co)
+        cookie_str = ', '.join(co)
+        if cookie_str:
+            env['HTTP_COOKIE'] = cookie_str
         # XXX Other HTTP_* headers
         # Since we're setting the env in the parent, provide empty
         # values to override previously set values
index 64025a3acb5e548fae64958efe1daeafd6079919..4e53f4279bd1c4c2f5d94f5879c05aea8f1a5072 100755 (executable)
@@ -1109,7 +1109,7 @@ def uname():
     except AttributeError:
         no_os_uname = 1
 
-    if no_os_uname or not filter(None, (system, node, release, version, machine)):
+    if no_os_uname or not list(filter(None, (system, node, release, version, machine))):
         # Hmm, no there is either no uname or uname has returned
         #'unknowns'... we'll have to poke around the system then.
         if no_os_uname:
index 44fc1b0acf71d25cd7ff63b478bb1a4b71fe99e0..0ce88de4c1683ee3435bf02b3c8a91f389cd6ca2 100644 (file)
@@ -118,12 +118,12 @@ def tabulate(r):
             L = L * (n // 4)
             # Force the elements to be distinct objects, else timings can be
             # artificially low.
-            L = map(lambda x: --x, L)
+            L = list(map(lambda x: --x, L))
         doit(L) # ~sort
         del L
 
         # All equal.  Again, force the elements to be distinct objects.
-        L = map(abs, [-0.5] * n)
+        L = list(map(abs, [-0.5] * n))
         doit(L) # =sort
         del L
 
@@ -131,11 +131,11 @@ def tabulate(r):
         # for an older implementation of quicksort, which used the median
         # of the first, last and middle elements as the pivot.
         half = n // 2
-        L = range(half - 1, -1, -1)
+        L = list(range(half - 1, -1, -1))
         L.extend(range(half))
         # Force to float, so that the timings are comparable.  This is
         # significantly faster if we leave tham as ints.
-        L = map(float, L)
+        L = list(map(float, L))
         doit(L) # !sort
         print()
 
index 3f186a6e15f9c523c9b109a672ab759969c163c8..5bbbd3daf17c24c826cda04a1454ecf30cd4162f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -84,6 +84,8 @@ C-API
 Library
 -------
 
+- Issue #8230: Fix Lib/test/sortperf.py.
+
 - Issue #7395: Fix tracebacks in pstats interactive browser.
 
 - Issue #1713: Fix os.path.ismount(), which returned true for symbolic links