Skip to content

Commit

Permalink
PEP8fy codebase: eliminated W503 flake8 error
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Mar 17, 2017
1 parent 3390867 commit b302374
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions cheroot/makefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ def recv(self, size):
self.bytes_read += len(data)
return data
except socket.error as e:
if (e.args[0] not in errors.socket_errors_nonblocking
and e.args[0] not in errors.socket_error_eintr):
if e.args[0] not in errors.socket_errors_nonblocking and e.args[0] not in errors.socket_error_eintr:
raise

class FauxSocket(object):
Expand Down
6 changes: 2 additions & 4 deletions cheroot/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,7 @@ def send_headers(self):
if status < 200 or status in (204, 205, 304):
pass
else:
if (self.response_protocol == 'HTTP/1.1'
and self.method != b'HEAD'):
if self.response_protocol == 'HTTP/1.1' and self.method != b'HEAD':
# Use the chunked transfer-coding
self.chunked_write = True
self.outheaders.append((b'Transfer-Encoding', b'chunked'))
Expand Down Expand Up @@ -1354,8 +1353,7 @@ def bind(self, family, type, proto=0):
# If listening on the IPV6 any address ('::' = IN6ADDR_ANY),
# activate dual-stack. See
# https://github.com/cherrypy/cherrypy/issues/871.
if (hasattr(socket, 'AF_INET6') and family == socket.AF_INET6
and host in ('::', '::0', '::0.0.0.0')):
if hasattr(socket, 'AF_INET6') and family == socket.AF_INET6 and host in ('::', '::0', '::0.0.0.0'):
try:
self.socket.setsockopt(
socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
Expand Down
9 changes: 6 additions & 3 deletions cheroot/test/webtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ def loadTestsFromName(self, name, module=None):

if isinstance(obj, types.ModuleType):
return self.loadTestsFromModule(obj)
elif (((six.PY3 and isinstance(obj, type))
or isinstance(obj, (type, types.ClassType)))
and issubclass(obj, unittest.TestCase)):
elif (
(
(six.PY3 and isinstance(obj, type)) or
isinstance(obj, (type, types.ClassType))
) and
issubclass(obj, unittest.TestCase)):
return self.loadTestsFromTestCase(obj)
elif isinstance(obj, types.UnboundMethodType):
if six.PY3:
Expand Down

0 comments on commit b302374

Please sign in to comment.