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

This commit is contained in:
Georg Brandl 2010-07-31 21:54:24 +00:00
parent 78aa396415
commit 62e2ca2193
3 changed files with 5 additions and 5 deletions

View file

@ -240,8 +240,7 @@ class sdist(Command):
optional = ['test/test*.py', 'setup.cfg'] optional = ['test/test*.py', 'setup.cfg']
for pattern in optional: for pattern in optional:
files = filter(os.path.isfile, glob(pattern)) files = filter(os.path.isfile, glob(pattern))
if files: self.filelist.extend(files)
self.filelist.extend(files)
# build_py is used to get: # build_py is used to get:
# - python modules # - python modules

View file

@ -1023,8 +1023,9 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
if ua: if ua:
env['HTTP_USER_AGENT'] = ua env['HTTP_USER_AGENT'] = ua
co = filter(None, self.headers.get_all('cookie', [])) co = filter(None, self.headers.get_all('cookie', []))
if co: cookie_str = ', '.join(co)
env['HTTP_COOKIE'] = ', '.join(co) if cookie_str:
env['HTTP_COOKIE'] = cookie_str
# XXX Other HTTP_* headers # XXX Other HTTP_* headers
# Since we're setting the env in the parent, provide empty # Since we're setting the env in the parent, provide empty
# values to override previously set values # values to override previously set values

View file

@ -1137,7 +1137,7 @@ def uname():
except AttributeError: except AttributeError:
no_os_uname = 1 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 # Hmm, no there is either no uname or uname has returned
#'unknowns'... we'll have to poke around the system then. #'unknowns'... we'll have to poke around the system then.
if no_os_uname: if no_os_uname: