Issue 3551: Raise ValueError if the size causes ERROR_NO_SYSTEM_RESOURCES
diff --git a/Modules/_multiprocessing/connection.h b/Modules/_multiprocessing/connection.h
index 458d1d3..c2f8563 100644
--- a/Modules/_multiprocessing/connection.h
+++ b/Modules/_multiprocessing/connection.h
@@ -131,8 +131,12 @@
 
 	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;
 }