[Python-checkins] r83371 - in python/branches/py3k/Lib: distutils/command/sdist.py http/server.py platform.py

georg.brandl python-checkins at python.org
Sat Jul 31 23:54:25 CEST 2010


Author: georg.brandl
Date: Sat Jul 31 23:54:24 2010
New Revision: 83371

Log:
#8292: Fix three instances of truth tests on return values of filter() (which is always true in Python 3).

Modified:
   python/branches/py3k/Lib/distutils/command/sdist.py
   python/branches/py3k/Lib/http/server.py
   python/branches/py3k/Lib/platform.py

Modified: python/branches/py3k/Lib/distutils/command/sdist.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/sdist.py	(original)
+++ python/branches/py3k/Lib/distutils/command/sdist.py	Sat Jul 31 23:54:24 2010
@@ -240,8 +240,7 @@
         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

Modified: python/branches/py3k/Lib/http/server.py
==============================================================================
--- python/branches/py3k/Lib/http/server.py	(original)
+++ python/branches/py3k/Lib/http/server.py	Sat Jul 31 23:54:24 2010
@@ -1023,8 +1023,9 @@
         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

Modified: python/branches/py3k/Lib/platform.py
==============================================================================
--- python/branches/py3k/Lib/platform.py	(original)
+++ python/branches/py3k/Lib/platform.py	Sat Jul 31 23:54:24 2010
@@ -1137,7 +1137,7 @@
     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:


More information about the Python-checkins mailing list