]> granicus.if.org Git - python/commitdiff
#8292: Fix three instances of truth tests on return values of filter() (which is...
authorGeorg Brandl <georg@python.org>
Sat, 31 Jul 2010 21:54:24 +0000 (21:54 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 31 Jul 2010 21:54:24 +0000 (21:54 +0000)
Lib/distutils/command/sdist.py
Lib/http/server.py
Lib/platform.py

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 d2a685f7974055ed810764c1e7a132f67e5d22ae..098ad250caca9d8d7e6a8d184ea2ad3656f2d414 100644 (file)
@@ -1023,8 +1023,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 75f92af006883a008c72d110adcda7ae65b998b0..f856a43c046caa76554819b3d30e64ee92625dfb 100755 (executable)
@@ -1137,7 +1137,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: