aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-16 17:18:34 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-16 17:18:34 -0700
commit48dd6bfb53ff9ddda39b9b2e6ced297e95027514 (patch)
tree46f0c63ecf93ed9ccf5bfda0aba501788744cca1 /src/python
parent18b4b8379259ffa73f8b5414a09bcb682d96b200 (diff)
parent94528cb58545a021df177e64a20efc91c1ac6226 (diff)
Merge github.com:grpc/grpc into you-complete-me
Diffstat (limited to 'src/python')
-rw-r--r--src/python/src/grpc/_adapter/_c/utility.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/python/src/grpc/_adapter/_c/utility.c b/src/python/src/grpc/_adapter/_c/utility.c
index 651ed3b0a2..3b004abf3d 100644
--- a/src/python/src/grpc/_adapter/_c/utility.c
+++ b/src/python/src/grpc/_adapter/_c/utility.c
@@ -169,6 +169,7 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
return 0;
}
c_op.op = type;
+ c_op.flags = 0;
switch (type) {
case GRPC_OP_SEND_INITIAL_METADATA:
if (!pygrpc_cast_pylist_to_send_metadata(
@@ -196,10 +197,11 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
return 0;
}
if (!PyTuple_Check(PyTuple_GET_ITEM(op, STATUS_INDEX))) {
- char buf[64];
- snprintf(buf, sizeof(buf), "expected tuple status in op of length %d",
- STATUS_TUPLE_SIZE);
- PyErr_SetString(PyExc_TypeError, buf);
+ char *buf;
+ gpr_asprintf(&buf, "expected tuple status in op of length %d",
+ STATUS_TUPLE_SIZE);
+ PyErr_SetString(PyExc_ValueError, buf);
+ gpr_free(buf);
return 0;
}
c_op.data.send_status_from_server.status = PyInt_AsLong(