mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Issue 3551: Raise ValueError if the size causes ERROR_NO_SYSTEM_RESOURCES
This commit is contained in:
parent
238cedcd63
commit
5053fbbb38
4 changed files with 21 additions and 4 deletions
|
|
@ -131,8 +131,12 @@ connection_sendbytes(ConnectionObject *self, PyObject *args)
|
|||
|
||||
res = conn_send_string(self, buffer + offset, size);
|
||||
|
||||
if (res < 0)
|
||||
return mp_SetError(PyExc_IOError, res);
|
||||
if (res < 0) {
|
||||
if (PyErr_Occurred())
|
||||
return NULL;
|
||||
else
|
||||
return mp_SetError(PyExc_IOError, res);
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue