diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index bb2106120ac..f51d72fad75 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -240,8 +240,7 @@ def add_defaults(self): 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 diff --git a/Lib/http/server.py b/Lib/http/server.py index d2a685f7974..098ad250cac 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -1023,8 +1023,9 @@ def run_cgi(self): 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 diff --git a/Lib/platform.py b/Lib/platform.py index 75f92af0068..f856a43c046 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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: