diff options
author | Nathaniel Manista <nathaniel@google.com> | 2015-06-16 17:13:44 -0700 |
---|---|---|
committer | Nathaniel Manista <nathaniel@google.com> | 2015-06-16 17:13:44 -0700 |
commit | 94528cb58545a021df177e64a20efc91c1ac6226 (patch) | |
tree | 829aaa0a621c05656a03c5a8f662d6d485380891 | |
parent | 32f020ae2a4c01eba236b3a93251ef9c18f606ec (diff) | |
parent | 9d3fbcf0ba248d981d26a6a3b9add6f85a5e2595 (diff) |
Merge pull request #2081 from soltanmm/c89-oops
Make warnings errors when building Python tests.
-rw-r--r-- | src/python/src/grpc/_adapter/_c/utility.c | 9 | ||||
-rwxr-xr-x | tools/run_tests/build_python.sh | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/python/src/grpc/_adapter/_c/utility.c b/src/python/src/grpc/_adapter/_c/utility.c index 64b3428f2b..97f2f35b8e 100644 --- a/src/python/src/grpc/_adapter/_c/utility.c +++ b/src/python/src/grpc/_adapter/_c/utility.c @@ -196,10 +196,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( diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 53db6af0ea..d9b7644f44 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -38,5 +38,5 @@ rm -rf python2.7_virtual_environment virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment source python2.7_virtual_environment/bin/activate pip install -r src/python/requirements.txt -CFLAGS="-I$root/include -std=c89" LDFLAGS=-L$root/libs/$CONFIG pip install src/python/src +CFLAGS="-I$root/include -std=c89 -Werror" LDFLAGS=-L$root/libs/$CONFIG pip install src/python/src pip install src/python/interop |