Issue 3551: Raise ValueError if the size causes ERROR_NO_SYSTEM_RESOURCES

This commit is contained in:
Jesse Noller 2009-04-02 04:22:09 +00:00
parent 238cedcd63
commit 5053fbbb38
4 changed files with 21 additions and 4 deletions

View file

@ -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;
}