aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/ssl.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-12-13 02:43:57 +0300
committershadchin <shadchin@yandex-team.com>2023-12-13 03:08:48 +0300
commit5b48aabc614c6d407f885f3b228dc484ad4c5ba9 (patch)
tree602eb5cc5d85bf730c1de1fa50a13c2ee552830d /contrib/tools/python3/src/Lib/ssl.py
parent35d7049b38602e8cbfcd3f96257329a1abce947e (diff)
downloadydb-5b48aabc614c6d407f885f3b228dc484ad4c5ba9.tar.gz
Update Python 3 to 3.11.7
Diffstat (limited to 'contrib/tools/python3/src/Lib/ssl.py')
-rw-r--r--contrib/tools/python3/src/Lib/ssl.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/tools/python3/src/Lib/ssl.py b/contrib/tools/python3/src/Lib/ssl.py
index 568d2e62b8..e7990a95dd 100644
--- a/contrib/tools/python3/src/Lib/ssl.py
+++ b/contrib/tools/python3/src/Lib/ssl.py
@@ -1316,10 +1316,14 @@ class SSLSocket(socket):
def recv_into(self, buffer, nbytes=None, flags=0):
self._checkClosed()
- if buffer and (nbytes is None):
- nbytes = len(buffer)
- elif nbytes is None:
- nbytes = 1024
+ if nbytes is None:
+ if buffer is not None:
+ with memoryview(buffer) as view:
+ nbytes = view.nbytes
+ if not nbytes:
+ nbytes = 1024
+ else:
+ nbytes = 1024
if self._sslobj is not None:
if flags != 0:
raise ValueError(