Skip to content

Commit

Permalink
formatting, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vashek committed Nov 2, 2020
1 parent 5af5b6a commit 4e1f101
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cheroot/makefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def write(self, b):
self._flush_unlocked()
return len(b)

def _safe_call(self, is_reader, call, *args, **kwargs): # noqa: C901
def _safe_call(self, is_reader, call, *args, **kwargs):
"""Call the supplied callable with retries, as needed.
Method to be overridden in subclasses/mix-ins.
Expand All @@ -50,7 +50,7 @@ def _flush_unlocked(self):
# ssl sockets only except 'bytes', not bytearrays
# so perhaps we should conditionally wrap this for perf?
n = self._safe_call(
False, self.raw.write, bytes(self._write_buf)
False, self.raw.write, bytes(self._write_buf),
)
except io.BlockingIOError as e:
n = e.characters_written
Expand Down
9 changes: 6 additions & 3 deletions cheroot/ssl/pyopenssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,13 @@ def sendall(self, *args, **kwargs):
"""Send whole message to the socket.
Not supported due to https://github.com/pyca/pyopenssl/issues/176.
Until that bug is fixed, sendall() may throw SSL.WantWriteError, but
there is no correct way to retry the call because we don't know how
many bytes were already transmitted. We could work around this by
reimplementing sendall() using send(), but we don't actually use
sendall() anywhere.
"""
raise NotImplementedError(
'sendall() not supported on pyOpenSSL due to issue #176'
)
raise NotImplementedError('sendall() is unsupported by pyOpenSSL')

def send(self, *args, **kwargs):
"""Send some part of message to the socket."""
Expand Down

0 comments on commit 4e1f101

Please sign in to comment.