diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-03 18:38:17 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-03 18:38:17 +0000 |
commit | 24e561ae0473ad6f46709e38ed8ebc97d89fc55e (patch) | |
tree | 7e536c12b8cc11641329f5354234bf627c943867 /Lib/ssl.py | |
parent | aa44b2b5ca45eaa0287fd59c62ed964550b7da96 (diff) | |
download | cpython-git-24e561ae0473ad6f46709e38ed8ebc97d89fc55e.tar.gz |
Issue #3805: clean up implementation of the _read method in _ssl.c.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r-- | Lib/ssl.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py index e83d889cdd..0c609be3d2 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -199,14 +199,14 @@ class SSLSocket(socket): self._checkClosed() try: - if buffer: - v = self._sslobj.read(buffer, len) + if buffer is not None: + v = self._sslobj.read(len, buffer) else: v = self._sslobj.read(len or 1024) return v except SSLError as x: if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: - if buffer: + if buffer is not None: return 0 else: return b'' |