Commits

Gustavo Picon committed 24033ac

Removed redundant parentheses

Comments (0)

Files changed (7)

cherrypy/lib/httputil.py

             # because we never want to fold lines--folding has
             # been deprecated by the HTTP working group.
             v = b2a_base64(v.encode('utf-8'))
-            return (b'=?utf-8?b?' + v.strip(b'\n') + b'?=')
+            return b'=?utf-8?b?' + v.strip(b'\n') + b'?='
 
         raise ValueError("Could not encode header part %r using "
                          "any of the encodings %r." %

cherrypy/lib/native_server.py

         # Set response headers
         for header, value in headers:
             req.outheaders.append((header, value))
-        if (req.ready and not req.sent_headers):
+        if req.ready and not req.sent_headers:
             req.sent_headers = True
             req.send_headers()
 

cherrypy/lib/server.py

             return self.socket_file
         if self.socket_host is None and self.socket_port is None:
             return None
-        return (self.socket_host, self.socket_port)
+        return self.socket_host, self.socket_port
 
     @bind_addr.setter
     def bind_addr(self, value):

cherrypy/lib/tools/caching.py

             total_size = self.cursize + size
 
             # checks if there's space for the object
-            if (size < self.maxobj_size and total_size < self.maxsize):
+            if size < self.maxobj_size and total_size < self.maxsize:
                 # add to the expirations list
                 expiration_time = response.time + self.delay
                 bucket = self.expirations.setdefault(expiration_time, [])
             cherrypy.log('Reading response from cache', 'TOOLS.CACHING')
         s, h, b, create_time = cache_data
         age = int(response.time - create_time)
-        if (age > max_age):
+        if age > max_age:
             if debug:
                 cherrypy.log('Ignoring cache due to age > %d' % max_age,
                              'TOOLS.CACHING')

cherrypy/lib/tools/static.py

         if index:
             handled = _attempt(os.path.join(filename, index), content_types)
             if handled:
-                request.is_index = filename[-1] in (r"\/")
+                request.is_index = filename[-1] in r"\/"
     return handled
 
 

cherrypy/test/logtest.py

         in_region = False
         for line in open(logfile, 'rb'):
             if in_region:
-                if (line.startswith(self.markerPrefix) and not marker in line):
+                if line.startswith(self.markerPrefix) and not marker in line:
                     break
                 else:
                     data.append(line)

cherrypy/test/test_xmlrpc.py

         except Exception:
             x = sys.exc_info()[1]
             self.assertEqual(x.__class__, Fault)
-            self.assertEqual(x.faultString, ("custom Fault response"))
+            self.assertEqual(x.faultString, "custom Fault response")
         else:
             self.fail("Expected xmlrpclib.Fault")